Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when reading Mas 200 table in VB .Net

Status
Not open for further replies.

wolfen1842

Programmer
Jan 24, 2007
4
US
I am trying to pull some data from Mas200 into a report that is generated in VB .Net. This report will have a separate line for each agent and each week. Here is the code I am using for the read:

dsEmp.Clear()
lsEmp = "SELECT SUM(Amount) AS Paid " & _
"FROM PR_23PerptHistoryDetail " & _
"WHERE Dept = '" & Mid$(drAgent("PayrollNumber"), 1, 2) & "' " & _
"AND EmployeeNumber = '" & Mid$(drAgent("PayrollNumber"), 3) & "' " & _
"AND CheckDate = {d '" & lsDate & "'} " & _
"AND (EarningCode = '90' OR EarningCode = '97') "
daEmp = New OdbcDataAdapter(lsEmp, cnODBC)
daEmp.Fill(dsEmp, "PR_23PerptHistoryDetail")
tblEmp = dsEmp.Tables("PR_23PerptHistoryDetail")

lsdate is a string field that holds the date in yyyy-mm-dd format.

When I run the report, the first time through this read procedure works fine. However, the second time through, I get the following error when it tries to do the fill command:

"ERROR [3700] [ProvideX][ODBC Driver]Expected lexical element not found: <identifier>"

Any ideas on what that error is? I haven't been able to find it anywhere on the net. Any ideas what I am doing wrong?

Thanks in advance for all the help.

John

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top