Someone got into my student file and destroyed one of the feields in it.

I need to change the SELECT SQL statement but just cannot find the correct
syntax.

This is what I have now:

UnivSQL="SELECT * FROM UNVRSTY WHERE NAME = '" & PgName & "' and PASSWRD =
'" & PgPass & "', acReadOnly"
rsUnivs.Open UnivSQL, Cnnct, 3, 3

I was informed to use ReadOnly, but I cannot find where to insert the
property.

Thanks in Advance

Granny

Re: Syntax for SQL SELECT Statement with ReadOnly by Dave

Dave
Wed Mar 15 19:06:52 CST 2006

Const adOpenForwardOnly = 0
Const adLockReadOnly = 1

rsUnivs.Open UnivSQL, Cnnct, adOpenForwardOnly, adLockReadOnly

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"GrandMaMa" wrote:
| Someone got into my student file and destroyed one of the feields in it.
|
| I need to change the SELECT SQL statement but just cannot find the correct
| syntax.
|
| This is what I have now:
|
| UnivSQL="SELECT * FROM UNVRSTY WHERE NAME = '" & PgName & "' and PASSWRD =
| '" & PgPass & "', acReadOnly"
| rsUnivs.Open UnivSQL, Cnnct, 3, 3
|
| I was informed to use ReadOnly, but I cannot find where to insert the
| property.
|
| Thanks in Advance
|
| Granny
|
|



Re: Syntax for SQL SELECT Statement with ReadOnly by GrandMaMa

GrandMaMa
Wed Mar 15 19:31:19 CST 2006

Dave; thanks for the quick come back, but I am still having a problem.

Added: Const adLockReadOnly = 1

Changed to: rsUnivs.Open UnivSQL, Cnnct, adLockReadOnly, 3, 3

Now get error message

ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

Thanks Again

Granny

"Dave Patrick" wrote:

> Const adOpenForwardOnly = 0
> Const adLockReadOnly = 1
>
> rsUnivs.Open UnivSQL, Cnnct, adOpenForwardOnly, adLockReadOnly
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "GrandMaMa" wrote:
> | Someone got into my student file and destroyed one of the feields in it.
> |
> | I need to change the SELECT SQL statement but just cannot find the correct
> | syntax.
> |
> | This is what I have now:
> |
> | UnivSQL="SELECT * FROM UNVRSTY WHERE NAME = '" & PgName & "' and PASSWRD =
> | '" & PgPass & "', acReadOnly"
> | rsUnivs.Open UnivSQL, Cnnct, 3, 3
> |
> | I was informed to use ReadOnly, but I cannot find where to insert the
> | property.
> |
> | Thanks in Advance
> |
> | Granny
> |
> |
>
>
>

Re: Syntax for SQL SELECT Statement with ReadOnly by Dave

Dave
Wed Mar 15 20:28:45 CST 2006

Yes, you have errors. Did you try what I posted?

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"GrandMaMa" wrote:
| Dave; thanks for the quick come back, but I am still having a problem.
|
| Added: Const adLockReadOnly = 1
|
| Changed to: rsUnivs.Open UnivSQL, Cnnct, adLockReadOnly, 3, 3
|
| Now get error message
|
| ADODB.Recordset (0x800A0BB9)
| Arguments are of the wrong type, are out of acceptable range, or are in
| conflict with one another.
|
| Thanks Again
|
| Granny



Re: Syntax for SQL SELECT Statement with ReadOnly by GrandMaMa

GrandMaMa
Wed Mar 15 20:50:26 CST 2006

Dave; Thanks Again!

I created the Const adLockReadOnly = 1, but not the OpenForward Variable.
The file is not always read sequencially.

I then changed my open connection to:

rsUnivs.Open UnivSQL, Cnnct, adLockReadOnly, 3, 3

I inheritted this page from the previous DB programmer. However I have
never understood why I have to have the 3, 3 at the end of my connection
statement.

I have searched for days to find out why I have to have it but never found
an answer. If I take it out however I get a halt.

Thanks Again

"Dave Patrick" wrote:

> Yes, you have errors. Did you try what I posted?
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "GrandMaMa" wrote:
> | Dave; thanks for the quick come back, but I am still having a problem.
> |
> | Added: Const adLockReadOnly = 1
> |
> | Changed to: rsUnivs.Open UnivSQL, Cnnct, adLockReadOnly, 3, 3
> |
> | Now get error message
> |
> | ADODB.Recordset (0x800A0BB9)
> | Arguments are of the wrong type, are out of acceptable range, or are in
> | conflict with one another.
> |
> | Thanks Again
> |
> | Granny
>
>
>

Re: Syntax for SQL SELECT Statement with ReadOnly by Dave

Dave
Wed Mar 15 21:19:19 CST 2006

Try;

'CursorType
Const adOpenForwardOnly = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3

'LockType
Const adLockReadOnly = 1
Const adLockPessimistic =2
Const adLockOptimistic = 3

rsUnivs.Open UnivSQL, Cnnct, adOpenDynamic, adLockReadOnly

"I have never understood why I have to have the 3, 3 at the end of my
connection"

You don't!

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"GrandMaMa" wrote:
| Dave; Thanks Again!
|
| I created the Const adLockReadOnly = 1, but not the OpenForward Variable.
| The file is not always read sequencially.
|
| I then changed my open connection to:
|
| rsUnivs.Open UnivSQL, Cnnct, adLockReadOnly, 3, 3
|
| I inheritted this page from the previous DB programmer. However I have
| never understood why I have to have the 3, 3 at the end of my connection
| statement.
|
| I have searched for days to find out why I have to have it but never found
| an answer. If I take it out however I get a halt.
|
| Thanks Again



Re: Syntax for SQL SELECT Statement with ReadOnly by GrandMaMa

GrandMaMa
Wed Mar 15 21:52:26 CST 2006

Dave;
Thanks a lot, I have a much better idea now.
Granny

"Dave Patrick" wrote:

> Try;
>
> 'CursorType
> Const adOpenForwardOnly = 1
> Const adOpenDynamic = 2
> Const adOpenStatic = 3
>
> 'LockType
> Const adLockReadOnly = 1
> Const adLockPessimistic =2
> Const adLockOptimistic = 3
>
> rsUnivs.Open UnivSQL, Cnnct, adOpenDynamic, adLockReadOnly
>
> "I have never understood why I have to have the 3, 3 at the end of my
> connection"
>
> You don't!
>
> --
>
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "GrandMaMa" wrote:
> | Dave; Thanks Again!
> |
> | I created the Const adLockReadOnly = 1, but not the OpenForward Variable.
> | The file is not always read sequencially.
> |
> | I then changed my open connection to:
> |
> | rsUnivs.Open UnivSQL, Cnnct, adLockReadOnly, 3, 3
> |
> | I inheritted this page from the previous DB programmer. However I have
> | never understood why I have to have the 3, 3 at the end of my connection
> | statement.
> |
> | I have searched for days to find out why I have to have it but never found
> | an answer. If I take it out however I get a halt.
> |
> | Thanks Again
>
>
>

Re: Syntax for SQL SELECT Statement with ReadOnly by Dave

Dave
Wed Mar 15 21:59:57 CST 2006

You're welcome.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"GrandMaMa" wrote:
| Dave;
| Thanks a lot, I have a much better idea now.
| Granny