Sunday, August 2, 2009

HOW to connect (ODBC) VB to SQL database but on local pc and not with server?

i already knw some syntax here it is , if u hv some idia about this pls do let me know


**************************************...





Public con As New ADODB.Connection


Public rst As New ADODB.Recordset





**************************************...


Public Sub connectsql()


con.ConnectionString = "provider=sqloledb.1 ; user id = prasad ; password = ********** ; initial catalog = student ;


data source = C:\Program Files\Microsoft Visual Studio\VB98\table_student.sql;"





con.Open


End Sub


**************************************...


Public Sub disconnectsql()


con.Close


con.Cancel





i hv doubt on data source and initial catalog


wat r they


i hv entered the initial catalog as table name and data source is the path for that file i.e. table student





In my college , server is there so i used to write data source as server overthere but wat should i write in my home ....


pls help me out

HOW to connect (ODBC) VB to SQL database but on local pc and not with server?
nitial catalog is refered as name of database and data source is uar s





Dim strConnection As String = _


"Data Source=localhost;Initial Catalog=Northwind;" _


%26amp; "Integrated Security=True"


erver name and u can use word localhost


No comments:

Post a Comment