by Cecilio Barra III (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 10th August 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Connect to a remote or network database using ADO
API Declarations
'Be sure to reference to Microsoft ActiveX Data Objects 2.0
dim conn as new ADODB.connection
dim rec as new ADODB.recordset
'where servername is the name of the computer
'in which this program connects and path is the
'path or folder in which the database file resides
'and the databasename is the name of the MSAccess Database
conn.open conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data " & _
"Source=\\ServerName\path\DatabseName;Persist " & _
"Security Info=False"
if conn.state = 1 then
'conncetion was successfully opened
msgbox "Connection Successful"
end if