ActiveX Component Can't Create Object

  • Thread starter Thread starter Kamil
  • Start date Start date
K

Kamil

Hello All,
I defined something below in General Declarations,

Dim FILE1 As Database
Dim TABLE1 As Recordset
Dim SSQL1 As QueryDef

And I wrote the following to the code of command1 to open my database and
make a query

Set FILE1 = OPENDATABASE("D:\VT.mdb")
Set SSQL1 = FILE1.CREATEQUERYDEF("SORGU", "SELECT * FROM MYTABLE1;")
Set TABLE1= FILE1.OPENRECORDSET("SORGU")

But I am getting the error in subject,
Why? Any suggestion please...
Regards...

Kamil
 
See whether it makes a difference if you use:

Dim FILE1 As DAO.Database
Dim TABLE1 As DAO.Recordset
Dim SSQL1 As DAO.QueryDef

(actually, only the middle one is essential, but there's no harm in being
explicit in all declarations)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top