|
-
Sep 26th, 2000, 09:46 AM
#1
Thread Starter
PowerPoster
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?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 26th, 2000, 09:57 AM
#2
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
-
Sep 26th, 2000, 09:58 AM
#3
Fanatic Member
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]
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Sep 26th, 2000, 01:35 PM
#4
Thread Starter
PowerPoster
Thank you both
It happened to be he damn ". Thanks guys.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|