|
-
Jun 4th, 2004, 06:24 PM
#1
Thread Starter
Lively Member
Newbie simple select statement
Hi People
Having a small problem with a select statement which I cant get my head around.Could someone show me the correct syntax Please?
I need to show records only for a particular Vacancy ID id so this is what i am attempting. this works if i remove the where statement,
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=MSDASQL;dsn=XPHOME;uid=Paul ;pwd=;database=ContractManagement;"
set Contacts as new Recordset
contacts.open " select lngVacancyID, lngContractorID,chrContractorName,chrContractorState,chrComments,chrInterviewDetails, blnSubmitted, blnSuccessful from tblsubmittedcontractors WHERE lngVacancyID = " & me.txtfields(0).text, db, adOpenStatic, adLockOptimistic
dgContacts.datasource = Contacts
dgContacts.refresh
-
Jun 4th, 2004, 07:15 PM
#2
Your syntax is correct.
Make sure txtFields(0).Text contains a valid lngVacancyId. Based on the naming convention, I am assuming that lngVacancyId is a numeric field and not a number stored in a character field. If that is not the case surround the value with single quotes.
Last edited by brucevde; Jun 4th, 2004 at 07:18 PM.
-
Jun 4th, 2004, 11:00 PM
#3
Thread Starter
Lively Member
Hi There
Thanks for the reply, I worked it out, I hadnt bound the text boxes to the datasource before attempting to bind the datagrid
Thanks for making me look!!
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
|