Data1.DatabaseName = from network server
-
i have problem with data1, i am trying to network a project of mine in VB6.. the scenario is this, i have an MS Flexgrid and i want to fill it with data from a Data1. the problem is that the ms access DB is located at the Local Server from our network at office. i was able to manage at least to connect the DB using the code below
Option Explicit
Dim cn As ADODB.Connection
Dim rs As ADODB.RecordsetPrivate Sub Form_Load()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strsql As String'-- get db path
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Data Source=\\IP Address or Computer Name\DIR\masterFile.mdb ;Persist Security Info = False"cn.Open Set rs = cn.Execute("select \* from dataTable")
End Sub
but i can't figure out how set the database name for data1
Data1.DatabaseName = "WHAT Should be the Path?" Data1.RecordSource = ("select \* dataTable order by Title")
how am i going to access the database and save it's content's to data1? thanks in advance.
-
i have problem with data1, i am trying to network a project of mine in VB6.. the scenario is this, i have an MS Flexgrid and i want to fill it with data from a Data1. the problem is that the ms access DB is located at the Local Server from our network at office. i was able to manage at least to connect the DB using the code below
Option Explicit
Dim cn As ADODB.Connection
Dim rs As ADODB.RecordsetPrivate Sub Form_Load()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strsql As String'-- get db path
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Data Source=\\IP Address or Computer Name\DIR\masterFile.mdb ;Persist Security Info = False"cn.Open Set rs = cn.Execute("select \* from dataTable")
End Sub
but i can't figure out how set the database name for data1
Data1.DatabaseName = "WHAT Should be the Path?" Data1.RecordSource = ("select \* dataTable order by Title")
how am i going to access the database and save it's content's to data1? thanks in advance.
DatabaseName was the fully qualified path to your database. In your case, it's exactly the same as your Data Source value in your connection string.
\\\\IP Address or Computer Name\\DIR\\masterFile.mdb
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
DatabaseName was the fully qualified path to your database. In your case, it's exactly the same as your Data Source value in your connection string.
\\\\IP Address or Computer Name\\DIR\\masterFile.mdb
A guide to posting questions on CodeProject[^]
Dave Kreskowiakgot my database running over LAN. thanks for the tips...