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