common method for database connection?
Posted on 2001-06-12
I wrote the following code in my MDIForm load method.....This is my first loading form name.So i wrote
the common coneection here.
But when i run this application ..i got compilation error
like "Invalid attribute in sub or function"..
Can u help me from this please...
Public Sub MDIForm_Load()
Dim sConnect As String
Public dfwConn As ADODB.Connection
Dim cmd As ADODB.Command
sConnect = "Provider=MSDASQL.1;Connect Timeout=15;Extended Properties='DSN=ACR;DBQ=c:\windows\desktop\ACRData.mdb;DriverId=281;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;';Locale Identifier=3081"
' open connection
Set dfwConn = New Connection
Set cmd = New Command
cmd.ActiveConnection = dfwConn
cmd.CommandType = adCmdStoredProc