ADODB 
Author Message
 ADODB

Am useing ADO to access DBase 5 files. With the following.

Dim dbs As New ADODB.Connection
Dim rstppmeetings As New ADODB.Recordset

dbs.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Price;Extended
Properties=dBase 5.0"
rstppmeetings.Open "MEETMENU", dbs

This works just fine whileever no one else has "MEETMANU.DBF" open if
someone else has "MEETMENU.DBF" open I get the following error.

"Runtime Error"
"Invalid SQL Statment, Expected - DELETE, INSERT, PROCEDURE, SELECT or
UPDATE"

opening in serveral modes ie "READ ONLY", "PESAMISTIC" etc, I have tried
using several Cursor types
Anyone got any ideas.

Thanks
Denton



Tue, 12 Oct 2004 12:48:21 GMT  
 ADODB
I'm not sure if it make a difference if you're using DBase5 or not, but I
don't think it does...

If your creating a recordset, you usually want to perform a SELECT, INSERT,
PROCEDURE, DELETE or UPDATE SQL statement when getting a recordset.  If you
need to just view the records from the set then create a statement

Dim strSQL as string

strSQL = "SELECT * FROM MEETMENU"
rstppmeetings.Open strSQL, dbs, (and add the appropriate cursor and lock
type for the information you need)

or alternatively, you could use the adCmdTable Constant in the
CommandTypeEnum Value option in your recordset

i.e. -

strSQL = "MEETMENU"
rrtppmeetings.open strSQL, dbs, adOpenStatic, adLockOptimistic, adCmdTable

I'm a relative newbie and this is my first reply post, so I'm not exactly
sure if that is 100% correct, but I think it should work correctly for what
you need to do.

Jim Jawn


Quote:
> Am useing ADO to access DBase 5 files. With the following.

> Dim dbs As New ADODB.Connection
> Dim rstppmeetings As New ADODB.Recordset

> dbs.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Price;Extended
> Properties=dBase 5.0"
> rstppmeetings.Open "MEETMENU", dbs

> This works just fine whileever no one else has "MEETMANU.DBF" open if
> someone else has "MEETMENU.DBF" open I get the following error.

> "Runtime Error"
> "Invalid SQL Statment, Expected - DELETE, INSERT, PROCEDURE, SELECT or
> UPDATE"

> opening in serveral modes ie "READ ONLY", "PESAMISTIC" etc, I have tried
> using several Cursor types
> Anyone got any ideas.

> Thanks
> Denton



Tue, 12 Oct 2004 19:25:46 GMT  
 ADODB
It does matter if someone else has the file open.  Access acts the same way.
It will work as long as there is no-one in the actual access file itself.

The file can't be open when you are trying to access it.  Most likely has
something to do with the inability to lock a record when someone else has
the file open.

K


Quote:
> Am useing ADO to access DBase 5 files. With the following.

> Dim dbs As New ADODB.Connection
> Dim rstppmeetings As New ADODB.Recordset

> dbs.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Price;Extended
> Properties=dBase 5.0"
> rstppmeetings.Open "MEETMENU", dbs

> This works just fine whileever no one else has "MEETMANU.DBF" open if
> someone else has "MEETMENU.DBF" open I get the following error.

> "Runtime Error"
> "Invalid SQL Statment, Expected - DELETE, INSERT, PROCEDURE, SELECT or
> UPDATE"

> opening in serveral modes ie "READ ONLY", "PESAMISTIC" etc, I have tried
> using several Cursor types
> Anyone got any ideas.

> Thanks
> Denton



Sun, 31 Oct 2004 13:01:34 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADODB.Connection and ADODB.Recordset question

2. ADODB.stream instead of ADODB.Stream

3. ADODB.stream instead of ADODB.Stream??

4. ADODB.Connection.Execute VS ADODB.Recordset.Update

5. ADODB.stream instead of ADODB.Stream??

6. Creating adodb.record from Adodb.recordset

7. ADODB.connection & ADODB.Recordset

8. Help needed with managing ADODB.Connection & ADODB.Command

9. defining ADODB.xxxxxxxxxx

10. defining ADODB.xxxxxxxxxx Type

11. Function to return ADODB.recordset: runtime error 13

12. CAN ADODB.PARAMETER VALUE BE NULL?

 

 
Powered by phpBB® Forum Software