>>*lcPermId = alltrim(companyinfo.PermID) && removed for testing >>lcPermID = '1178072' >>lnProgramYear = companyinfo.yearproduced >>lcRawTable = addbs(fileloc) + "surveys\RawData" + transform(lnProgramYear) + '.dbf' >> >>lcConnectionString = "DRIVER=SQL Server;SERVER=PAG-SQLSERVER;" + ; >> "UID=DonF;APP=Microsoft Visual FoxPro;" + ; >> "WSID=TPD284;DATABASE=TRPSurvey;Trusted_Connection=Yes" >>lnHandle = sqlstringconnect(m.lcConnectionString) >>lcSQL = "select * " + ; >> "from TRPSurvey" + "..exported " + ; >> "where lcPermID = alltrim(PermID)" >> >>sqlexec(m.lnHandle,lcSQL,"crsImport") >>sqldisconnect(m.lnHandle) >>>>
>"where lcPermID = '"+alltrim(PermID)+"'" >Looks like it should be the other way around, though I may be wrong. PermID sounds more like a field name than lcPermID.