borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (listing server and client)Next Topic (Calling ini file (problem with code)) New Topic New Poll Post Reply
AndreaVB Forum : API : DBF Linking Problem
Poster Message
x_router
Level: Graduate

Registered: 07-05-2006
Posts: 9

icon DBF Linking Problem

Hi guys!

Im trying to link a dbf file using adodb. please see my code below:

Set cn = New ADODB.Connection
Set rs = new ADODB.recordset
    If cn.State = adStateOpen Then cn.Close
        cn.Open "Driver={Microsoft Visual Foxpro Driver};" & _
               "SourceType=DBF;" & _
               "SourceDB=c:\payroll\Paydata\attenda.dbf;" & _
               "Exclusive=No;"
        cn.CursorLocation = adUseClient


strSQL = "select * from attenda"
' attenda is table name

rs.Open strSQL, cn, adOpenKeyset, adLockOptimistic, adCmdText

i encountered ERROR MSG "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another"

when i checked cn it was empty.

i really need your knowledge with this. please help me guys!

thanks in advance

12-09-2006 at 12:34 PM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: DBF Linking Problem

Hi x

I tried your code and it worked up to the rs.open where i didn't have your foxpro table , so thats no surprise. Which version of ado are you using?



Steve  

12-09-2006 at 01:38 PM
View Profile Send Email to User Show All Posts | Quote Reply
x_router
Level: Graduate

Registered: 07-05-2006
Posts: 9
icon Re: DBF Linking Problem

im using ADO Data Control 6.0

15-09-2006 at 05:24 AM
View Profile Send Email to User Show All Posts | Quote Reply
Aleks
Level: Scholar


Registered: 10-11-2003
Posts: 32
icon Re: DBF Linking Problem

Try to use te reference to MS ADO 2.5 or higher libraries first, in order to handle the connection trough code and not use the FoxPro drivers, try to use the "DRIVER={Microsoft dBase Driver (*.dbf)}", because not all the machines can have installed the VFP driver and setupīd.
Set the default directory to the path of .DBF also. Depending the SQL syntax the DBF driver can not support the command.


____________________________
Aleks

27-01-2007 at 08:35 PM
View Profile Send Email to User Show All Posts ICQ | Quote Reply
AndreaVB Forum : API : DBF Linking Problem
Previous Topic (listing server and client)Next Topic (Calling ini file (problem with code)) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder