|
-
Jun 3rd, 2003, 12:58 PM
#1
Thread Starter
Member
Connecting to DB...again
I know the question has been asked a few times already, but I needed some clarification.
I am new to using a database with my vb app. Initially, I added the ADO Data Control 6.0 component to my project, and used that to setup the conenction to my access database. And I used the following code to do my sql queries:
VB Code:
'Query to get users id from the database
strSql = "SELECT UserID FROM Users " & _
"WHERE Name = '" & strUserName & "'"
adoOnline.RecordSource = strSql
adoOnline.Refresh
'Store user id
intUserID = adoOnline.Recordset("UserID")
I did it this way because in my vb book that I am using for reference, they included this component along with the datagrid.
Is it that when you don't have any data bound controls (like the datagrid, flexgrid etc), you don't need to use the ADO data control and you should do the connections to the database in the code?
I know now how to do the connection do the database without the ado data control component. I searched before posting. So no need to post that code.
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
|