I'm trying to run a select query in vb 6 and get the error "too few parameters, expected 1". I believe it has to do with the syntax of the script, but I can't figure out what it is.
Here's my code:
strcnn = "Provider=MSDASQL.1;Persist Security info=False;Data Source=dBASE Files;Initial Catalog=" & test_dir
Set cnn = New ADODB.Connection
cnn.Open strcnn
TypeSave = rsttable2!Type
Set rsttable = cnn.Execute("select * from oldnew where left(new,4) = '" & TypeSave & "'"
Oldnew is a dbase database and new is a legitimate column in oldnew.dbf. Any ideas??
Here's my code:
strcnn = "Provider=MSDASQL.1;Persist Security info=False;Data Source=dBASE Files;Initial Catalog=" & test_dir
Set cnn = New ADODB.Connection
cnn.Open strcnn
TypeSave = rsttable2!Type
Set rsttable = cnn.Execute("select * from oldnew where left(new,4) = '" & TypeSave & "'"
Oldnew is a dbase database and new is a legitimate column in oldnew.dbf. Any ideas??