-
my problem:
Dim EName As String
EName = "Stanich JR, James A"
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & TimeDatabase
rst.Open _
"Select EmployeeFull from Employee_Info where_ EmployeeFull='" & EName & "'"" _
, cnn, adOpenStatic, adLockPessimistic
I keep getting a syntax error.
Any suggestions?
-
I think the problem is in the WHERE clause. You have extra double quote.
Code:
Dim strName As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strSQL As String
strName = "Stanich JR, James A"
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & TimeDatabase
strSQL = "Select EmployeeFull from Employee_Info Where EmployeeFull='" & strName & "'"
rs.Open strSQL, cn, adOpenStatic, adLockPessimistic
-
Try removing the last " from the SQL statement.
[Couldn't quite get in before Serge!!] ;)
[Edited by Stevie on 09-26-2000 at 11:00 AM]
-
Thank you both
It happened to be he damn ". Thanks guys.