Link to home
Start Free TrialLog in
Avatar of kingno1
kingno1

asked on

VB and SQL Server

Hi,
    I am running SQL Server as my Database(back end) with Visual Basic as my front end. I am filling the GUI forms which has to store the data that is filled in to SQL server database. also, I want to retrieve the data from the SQL Server database.
I tried to use ADO CONTROL(adodc) But i was unable to connect to the database. Can someone help me with this. i.e. how to connect the SQL Server with the visual basic?????
thanks,
kingno1
kingno1@hotmail.com
ASKER CERTIFIED SOLUTION
Avatar of stefie
stefie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kingno1
kingno1

ASKER

Hi Stefie,
              Thank you very much for your response. I tried the code that you send me . But, the problem is where to include that code. in the form_load? or in ADODC??
I was unable to catch your point. Also, how to connect the specific fields on the visual basic forms to the Sql server database table fields. Again thanks for ur response.  Anybody, please help me out.
Is DSN means datasource that we set to ODBC?
Put this code where you normally open your database.
The DSN is indeed the DSN in your ODBC, the databasename must also be the same as the one in your ODBC-settings.

Later on, you can do the job on the database (in this example dbDatabase) the same way you do it with DAO. So you can use recordsets or execute SQL-statements (in the form you can put 'em in your SQL-Querytool).



Avatar of kingno1

ASKER

ANY ONE PLEASE HELP ME IN SOLVING MY PROBLEM!!!!!!!!!
Hi,
Sorry for bothering u again. I tried ur method. But, its giving me the problem.
I will explain everything once. I have GUI visual basic forms and the SQL Server Database. I want to enter or Browse the data into the database which is connected to SQL server. But the problem was I was unable to connect it. I made the settings in ODBC data sourses. But, the ADO control is not working. I have to connect each field in the form to a particular column in the database. But, when I tried to connect the datasource property of the text box.. its noe showing me the browsing symbol, so, I cannt connect that text box to the database.
Can u explain clearly how to do this, Else if u want I can email my program to you.

Thank you very much
kingno1@hotmail.com