I am using VB6 connecting to Oracle 8.0.5 database via DAO trying to select data that will be inserted into local database (oracle lite), but keep getting an error 3146: ODBC Call--Failed when trying to select the data. I have changed the original program to include dialog box that gives the user option to select a specific type of order, ie. Open, Closed, Archived.
The original SQL statement is;
strSQL = "SELECT status, " & _
"projectNumber, " & _
"customerNumber, " & _
"customer, " & _
"Office, " & _
"CheckOutBy " & _
"FROM Project " & _
"ORDER BY projectNumber"
Set rsProjects = ObjServerCon.OpenRecordset(strSQL, dbOpenDynaset)
'This runs fine and I get all projects from the database
I have changed the original code to add a variable (strFiltName1) set by user via radio buttons on dialog box;
strSQL = "SELECT status, " & _
"projectNumber, " & _
"customerNumber, " & _
"customer, " & _
"Office, " & _
"CheckOutBy " & _
"FROM Project " & _
"WHERE Status LIKE " & strFiltName1 & _
" ORDER BY projectNumber"
Set rsProjects = ObjServerCon.OpenRecordset(strSQL, dbOpenDynaset)
The variable strFiltName1 shows the user selected variable correctly, but I keep getting the error.
If I'm leaving out any information please let me know.
Thanks,
Darrel
The original SQL statement is;
strSQL = "SELECT status, " & _
"projectNumber, " & _
"customerNumber, " & _
"customer, " & _
"Office, " & _
"CheckOutBy " & _
"FROM Project " & _
"ORDER BY projectNumber"
Set rsProjects = ObjServerCon.OpenRecordset(strSQL, dbOpenDynaset)
'This runs fine and I get all projects from the database
I have changed the original code to add a variable (strFiltName1) set by user via radio buttons on dialog box;
strSQL = "SELECT status, " & _
"projectNumber, " & _
"customerNumber, " & _
"customer, " & _
"Office, " & _
"CheckOutBy " & _
"FROM Project " & _
"WHERE Status LIKE " & strFiltName1 & _
" ORDER BY projectNumber"
Set rsProjects = ObjServerCon.OpenRecordset(strSQL, dbOpenDynaset)
The variable strFiltName1 shows the user selected variable correctly, but I keep getting the error.
If I'm leaving out any information please let me know.
Thanks,
Darrel