rajani50
asked on
common method for database connection?
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...
rgds,
rajani
Public Sub MDIForm_Load()
Dim sConnect As String
Public dfwConn As ADODB.Connection
Dim cmd As ADODB.Command
'set strings
sConnect = "Provider=MSDASQL.1;Connec t Timeout=15;Extended Properties='DSN=ACR;DBQ=c: \windows\d esktop\ACR Data.mdb;D riverId=28 1;FIL=MS Access;MaxBufferSize=2048; PageTimeou t=5;UID=ad min;';Loca le Identifier=3081"
' open connection
Set dfwConn = New Connection
dfwConn.Open sConnect
Set cmd = New Command
cmd.ActiveConnection = dfwConn
cmd.CommandType = adCmdStoredProc
End Sub
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...
rgds,
rajani
Public Sub MDIForm_Load()
Dim sConnect As String
Public dfwConn As ADODB.Connection
Dim cmd As ADODB.Command
'set strings
sConnect = "Provider=MSDASQL.1;Connec
' open connection
Set dfwConn = New Connection
dfwConn.Open sConnect
Set cmd = New Command
cmd.ActiveConnection = dfwConn
cmd.CommandType = adCmdStoredProc
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER