• Welcome to Valhalla Legends Archive.
 

OpenDatabase()-AcitveX can't create object

Started by CrAz3D, April 03, 2004, 04:19 PM

Previous topic - Next topic

CrAz3D

I keep receiving the error "ActiveX can't create object

I know that the path is correct & that Ham.mdb does, in fact, exsist.  Any ideas?
Global TresDB as Object
Set TresDB = OpenDatabase("C:\Documents and Settings\Owner\Desktop\Ham.mdb")
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Adron

Perhaps your database drivers aren't correctly registered? Which one is it you're trying to use?

CrAz3D

Hmm.  I'm just trying to open Ham.MDB, a regular Access database located on my desktop.

Something that COULD be confliciting also, I "do not have a license" to use a data enviroment in ANY project on my computer.  I've reinstalled VB twice now & I am thinking that solving this could solve the OpenDatabase error, or @ least bring me closer.
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Adron

Quote from: CrAz3D on April 04, 2004, 10:38 PM
Something that COULD be confliciting also, I "do not have a license" to use a data enviroment in ANY project on my computer.  I've reinstalled VB twice now & I am thinking that solving this could solve the OpenDatabase error, or @ least bring me closer.

Do you have VB Pro? IIRC, in some VB versions, opening a database without any gui object attached to it was restricted to the Pro version.

I'm still wondering where your OpenDatabase function is coming from, go check that?

CrAz3D

#4
This is just code I am editting from the previous person that worked on it.  It is a fundraiser database for my school band, I'm not sure where they got the OpenDatabase Function.


Licensing issue fixed.

OpenDatabase is prob now.
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Grok

Quote from: CrAz3D on April 05, 2004, 07:24 PM
Licensing issue fixed.

OpenDatabase is prob now.

What does this mean?  You didn't answer Adron's valid questions.  What edition of VB is this?  Pro?  Enterprise?  Warez or legit?

What are the listed references in the menu Project|References?

It's quite possible your scope includes multiple OpenDatabase functions, or at least the wrong one than you are expecting.  Which technology are you expecting OpenDatabase to come from?  DAO?  3.5? 4.0? 4.5?  Depending on your answer, is the proper typelib selected in references?

If you want help you have to give the helpers more than enough information.  Try to guess what we would need to solve the problem, then give that and more!

Grok


   Dim sDB As String
   Dim wrkJet As Workspace
   Dim TresDB As Object
   
   ' Create Microsoft Jet Workspace object.
   Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
   
   sDB = "D:\VS6\VB98\NWIND.MDB"
   Set TresDB = wrkJet.OpenDatabase(sDB, True)


works fine here with Microsoft DAO 3.6 referenced.

CrAz3D

Quote from: Grok on April 05, 2004, 08:19 PM
Quote from: CrAz3D on April 05, 2004, 07:24 PM
Licensing issue fixed.

OpenDatabase is prob now.

What does this mean?  You didn't answer Adron's valid questions.  What edition of VB is this?  Pro?  Enterprise?  Warez or legit?

What are the listed references in the menu Project|References?

It's quite possible your scope includes multiple OpenDatabase functions, or at least the wrong one than you are expecting.  Which technology are you expecting OpenDatabase to come from?  DAO?  3.5? 4.0? 4.5?  Depending on your answer, is the proper typelib selected in references?

If you want help you have to give the helpers more than enough information.  Try to guess what we would need to solve the problem, then give that and more!

My ignorance.  Visual Basic 6.0 Professional Ed, from Hastings w/a student discount.

I'll try using the wrkJet method you listed above, thank you
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

CrAz3D

Grok, in your code, what is the Workspace?
Is it the data enviroment?
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Adron

A Workspace is one of the DAO classes. IIRC it represents a session to DAO, in which you can have open databases/connections. Transactions are local to a workspace. I also think you can have different usernames active in different workspaces.