Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP to Access Again
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
VFP to Access Again
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Miscellaneous
Thread ID:
01314382
Message ID:
01314382
Views:
52
I run this code at work and it has no errors. When I run it at home I get a parameter screen popup when the insert command runs and when I take the question marks out I get a 'connectivity error(ODBC Microsoft Access Driver) too few parameters...4 expected'

What do I need to look for in differences in both. I run vfp 9 in both places. SP1 at home, SP2 at work and Access 2002 home and Access 2003 at work.


*******
lnHandle = sqlstringconnect('Driver=Microsoft Access Driver (*.mdb);' + ;
'dbq=H:\Source Code\Access Test\db1.mdb')
IF lnHandle < 1
AERROR(laError)
MESSAGEBOX(laError[1,2])
RETURN
ENDIF
USE table1 &&& Fox Table with same stucture
SCAN
cAccid=table1.accid
cAccountnum=table1.accountnum
cAccountNam=table1.accountnam
cPswd=table1.pswd
lnResult = SQLEXEC(lnHandle, 'INSERT INTO accounts ' + ;
'(accid, accountnumber, accountname, pswd)' + ;
'VALUES (?cAccid, ?cAccountnum, ?cAccountNam, ?cPswd)')

IF lnResult < 1
AERROR(laError)
MESSAGEBOX(laError[1,2])
RETURN
ENDIF
ENDSCAN
USE
SQLDISCONNECT(lnHandle)
RETURN
Jules
Next
Reply
Map
View

Click here to load this message in the networking platform