I would like to know the way to link a specific field from my DB file to a vairble in visual basic. Lets say a specific field has the number 4 in it and i want to have the 4 be linked to a line of code in Visual Basic 2003. is there an easy way to do this. ive been able to link data from my DB to specific labels on my form but its not what im looking for.
Access Database
Collapse
X
-
Tags: None
-
Hi. It is the word 'link' that is troubling me. Are you asking to 'bind' a control to a database field or just have that control be updated to the value of a particular field? -
i want to be able to call a particualr field and use the data, either a string or integer, within that field as a varible in my code. something like an if statement.
if (particular field) = 1 then....Comment
-
Then you would normally use ADO which is quite a steep learning curve, just want you to know that :)
You need an ADODB.Connectio n object and an ADODB.Recordset object. You will use an SQL statement to retrieve the data from your database and the recordset object will contain the data.
Good luckComment
Comment