I am creating an application in Visual Basic 6.0 which has SQL server as its database. I want to connect to the database without having MS SQL service manger installed on the client. How can this be done? Should i add any dll's or .tbl or .ocx files?
views:
61answers:
2
A:
Depends on how you want to connect to the server. If you look at the control panel on the clients computer, does it have an applet called ODBC in there? (Might also be in the Admin Tools folder instead of straight in the control panle).
If so, try creating a link to the SQL Server DB, and if that works you might not need anything else. If that's missing you might need to install MDAC to get the correct drivers on there.
After that it is just to write your normal code in VB6 (probably using ADO).
ho1
2010-10-18 10:38:06
No it does not have an applet called ODBC
2010-10-18 11:13:37
@user: Then install a suitable version of MDAC and one should appear.
ho1
2010-10-18 11:50:47
i have installed suitable version of MDAC but still i am getting an error telling sql server does not exist or access denied in this line "dbcon.Open "Provider=sqloledb;Data Source=maram20;Initial Catalog=haidata;User ID=sa;Password=;"
2010-10-18 13:55:50
Validate you connection string properties first. Once you have MDAC installed you should be able to choose a provider when creating a connection to a database with the ODBC Manager.Open your Data Source (ODBC) manager by either going here:Control Panel >> Administration Tools >> Data Sources (ODBC) or type `odbcad32` into your windows run prompt (Start >> Run...).Create a ODBC connection in the manager, selecting on of the installed SQL Drivers.Fill in the blanks and keep clicking the `Next` button.At the last dialog you see a button `Test Data Source...`.
François
2010-10-18 14:24:56
Fix any issues here until you are able to connect. Once able to connect, use the correct properties / credentials in your code.
François
2010-10-18 14:25:20
A:
Goner Doug
2010-10-18 19:42:49