Hi everyone ...
I am using an ADODB connection in a .BAS module(it accepts a strSQL as its' input) to run a simple select statement on an Access DBase. I use the return to dynamically add Option buttons and name them according to the business names returned.
That works great, but when I try to pass the .BAS procedure a different SQL statement, it does not return any records.
Here is the calling code ...
Private Sub Option1_Click(Index As Integer)
Dim strCoName As String
Dim strSQL As String
strCoName = Option1(Index).Caption
strSQL = "Select * From Suppliers where CompanyName = '" & strCoName & "'"
modTestConnect.ConnectToDBase (strSQL)
MyRS.Fields.Item("Dropped"
.Value = True
MyRS.Update
End Sub
The original SQL that works is ...
strSQL = "SELECT CompanyName FROM Suppliers WHERE dropped = false;"
The only difference I see is the second SQL does not have the ; at the end. Could that be the problem? If so, where do I include it?
I am using an ADODB connection in a .BAS module(it accepts a strSQL as its' input) to run a simple select statement on an Access DBase. I use the return to dynamically add Option buttons and name them according to the business names returned.
That works great, but when I try to pass the .BAS procedure a different SQL statement, it does not return any records.
Here is the calling code ...
Private Sub Option1_Click(Index As Integer)
Dim strCoName As String
Dim strSQL As String
strCoName = Option1(Index).Caption
strSQL = "Select * From Suppliers where CompanyName = '" & strCoName & "'"
modTestConnect.ConnectToDBase (strSQL)
MyRS.Fields.Item("Dropped"
MyRS.Update
End Sub
The original SQL that works is ...
strSQL = "SELECT CompanyName FROM Suppliers WHERE dropped = false;"
The only difference I see is the second SQL does not have the ; at the end. Could that be the problem? If so, where do I include it?