PDA

Click to See Complete Forum and Search --> : My Syntax is Suffering


Skrmetti
Jul 20th, 1999, 06:14 PM
Being a slow-witted newbie, I have been painfully attempting to string together my first app, and thanks especially to the ubiquitous Preeti and the web-based tutorials of Dale Shaw and Karl Moore it has been coming along nicely. However, I have some problems with syntax and I am pretty clueless. I think I'm at the point where I know what I'm doing and I just don't know exactly how to express it. If anybody could tell me what's wrong with the following code, I'd appreciate it.

TIA,
Jonathan

SQL$ = "SELECT * FROM " & strTable
SQL$ = SQL$ & " WHERE " & strFindBy
SQL$ = SQL$ & " = " & strMatchWith
SearchSQL = SQL$
Dim db As Database
Set db = OpenDatabase(There is a database directory here, but for company security reasons I can't post it)
Set Adodc1.Recordset = db.OpenRecordset(SearchSQL)
MSHFlexGrid1.Visible = True
End Sub

------------------
"Black?"
"For over thirty years."

Serge
Jul 20th, 1999, 06:39 PM
What is the value for strMatchWith ??? According to naming convention - its a string....then you're missing single quotes:

SQL$ = "SELECT * FROM " & strTable
SQL$ = SQL$ & " WHERE " & strFindBy
SQL$ = SQL$ & " = '" & strMatchWith & "'"
SearchSQL = SQL$


Reagrds,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com

Skrmetti
Jul 20th, 1999, 07:38 PM
Thank you, Serge. The SQL is not giving me trouble anymore. As for the ADO control... rrrrrrr.

Thanks,
Jonathan