Can anyone help me with this problem? I have to create a program that transfer a .dbf to a sql database on a daily basis. I have check with all the treads available but I'm still not getting any results. I'm getting the connection to the sql server but its not writing to the sql database.
I'm getting an error on the sqlexec() saying:
"Connectivity Error [Microsoft[ODBC SQL Server Driver][SQL Server] The name 'strlname' is not permitted in this context. Only Constants, expressions, or variables allowed here. Column names are not permitted."
strlname is a variable.
my code is as follows:
select loctable
nHandle=SQLCONNECT('sqlconnection')
IF nHandle > 0
else
= MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
ENDIF
nhandle = sqlconnect('sqlconnection')
? SQLSETPROP(nHandle, 'Transactions', 2) && Manual transactions
scan
datestring = dtos(c.bdate)
strlname = c.lname
strfname = c.fname
strmname = c.mname
strssn = c.ssn
? SQLEXEC(nHandle, "INSERT INTO sqlname VALUES ;(strlname, strfname, strmname, strssn, datestring)")
IF SQLEXEC(nhandle,"INSERT INTO sqlname VALUES ;(strlname, strfname, strmname, strssn, datestring)") < 0
AERROR(laError)
DISPLAY MEMORY LIKE laError
ENDIF
? SQLCOMMIT(nHandle) && Commit the changes
endscan
Thank you for any help you can give me.
Kate
I'm getting an error on the sqlexec() saying:
"Connectivity Error [Microsoft[ODBC SQL Server Driver][SQL Server] The name 'strlname' is not permitted in this context. Only Constants, expressions, or variables allowed here. Column names are not permitted."
strlname is a variable.
my code is as follows:
select loctable
nHandle=SQLCONNECT('sqlconnection')
IF nHandle > 0
else
= MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
ENDIF
nhandle = sqlconnect('sqlconnection')
? SQLSETPROP(nHandle, 'Transactions', 2) && Manual transactions
scan
datestring = dtos(c.bdate)
strlname = c.lname
strfname = c.fname
strmname = c.mname
strssn = c.ssn
? SQLEXEC(nHandle, "INSERT INTO sqlname VALUES ;(strlname, strfname, strmname, strssn, datestring)")
IF SQLEXEC(nhandle,"INSERT INTO sqlname VALUES ;(strlname, strfname, strmname, strssn, datestring)") < 0
AERROR(laError)
DISPLAY MEMORY LIKE laError
ENDIF
? SQLCOMMIT(nHandle) && Commit the changes
endscan
Thank you for any help you can give me.
Kate