Lorna
September 14th, 2001, 02:59 AM
Hi
I'm developing a Data Tier that just makes a connection to a db. The configuration is as follows:
dll = PdataTier.clsemps
SQLserver name = Lorna
DB name = LornaDB
Table name = EMPS
Code looks as follows
private Sub Class_Initialize()
set cnMaindata = new ADODB.Connection
With cnMaindata
.Provider = "SQLOLEDB.1;Persist Security Info=false;User ID=sa;Initial Catalog=LornaDB;Data Source=LORNA"
.DefaultDatabase = "lornadb"
.Open
End With
set rsEmps = new ADODB.Recordset
rsEmps.Open "Emps", cnMaindata, adOpenDynamic, adLockOptimistic
End Sub
I created an Exe project just to check that the dll connects - I need to use late binding for this project (it becomes a distributed App later on...)
Dim P as Object
private Sub Command1_Click()
set P = CreateObject("pdataTier.clsemps", "Lorna")
End Sub
when the exe runs, I get the error message " OPERATION IS NOT ALLOWED WHEN THE OBJECT IS CLOSED" NO 3704
I'm new to all this - can anyone help me?
Thanx
I'm developing a Data Tier that just makes a connection to a db. The configuration is as follows:
dll = PdataTier.clsemps
SQLserver name = Lorna
DB name = LornaDB
Table name = EMPS
Code looks as follows
private Sub Class_Initialize()
set cnMaindata = new ADODB.Connection
With cnMaindata
.Provider = "SQLOLEDB.1;Persist Security Info=false;User ID=sa;Initial Catalog=LornaDB;Data Source=LORNA"
.DefaultDatabase = "lornadb"
.Open
End With
set rsEmps = new ADODB.Recordset
rsEmps.Open "Emps", cnMaindata, adOpenDynamic, adLockOptimistic
End Sub
I created an Exe project just to check that the dll connects - I need to use late binding for this project (it becomes a distributed App later on...)
Dim P as Object
private Sub Command1_Click()
set P = CreateObject("pdataTier.clsemps", "Lorna")
End Sub
when the exe runs, I get the error message " OPERATION IS NOT ALLOWED WHEN THE OBJECT IS CLOSED" NO 3704
I'm new to all this - can anyone help me?
Thanx