Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application-defined or object-defined error

Status
Not open for further replies.

MacChris

Programmer
Feb 8, 2005
13
CH
Hi I'm using VB 6 and MS Access 2000
I like to have a Data Report to display and print data.
so far so good
it working fine aslong i'm running the .exe file on my dev. Maschine.
on all other PC's it say allways this App / Obj Error and
Invalid Data Source for this DataReport Object

Source are somthing Like:
create Obj conn_Database
cretae Conn to Table with a SQL Statement
run DataReport with xxxx.refresh / xxxx.show
Q: can someone tell my why ?
do I need some additionals Installations on other PC's ?

regards
Chris
 
You didn't show exactly how you are connecting to the database but perhaps you are using a DSN ?

If so then all of the other machines a DSN the same as the one on your machine.
 
Is it possible that this exact path does not exist on the second computer?

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\DataReport.mdb;Persist Security Info=False


Also the problem may be that a required external file is missing from the second computer. Use the Package & Deployment Wizard to create an Install program so that you can be certain that required dependancies are present on the second machine.
 
It's a good thing do check it. thx
because i'm not so fam. with this Package & ... so i us allways the standard wizard to Package the SW and standard Installation on other PC's.
this will take a few time (PC are at home and i be on working yet)
Thanks at this time
regards
Christian
 
Oh, yes the standard one is the one that I use... On my computer it has the name "Package & Deployment Wizard" ... it is the install creator that came with Visual Studio.
 
yes i'm using Package & Deployment Wizard and it's still not working like i used it from begin.
The installation will be done with the created Setup.exe and .cab file.
and even wenn i create this directories and copy all files into its not working.
Chris
 
Did you add the DataReport.mdb file to the package?
 
Dear Sheco

One small step for man one giant step for mankind
Like it was just a small thing for you and somthing unknowing staff for me. It's working but i have to enter in this ' Geben Sie bitte MS JET OLE-DB-Initialisierungsinformationen ein. ' Windows the Datasource Username Password ....
Are there some code do to it autumatical on VB and where ist the Place do to that?

regards
Chris
 
Private Sub Form_Initialize()

DataEnvironment.Connection.Close
DataEnvironment.Connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & " /Datenbank.mdb;Persist Security Info=False"
DataEnvironment.Connection.Open

End Sub

Thanks Sheco for your Help
 
I'm not sure that I understand... is it prompting the user for a database passowrd?
 
Yes, it's appear when die Data Source can not be located. It's define manually the Path and Username ... the new ConnectionString.
Or thake the Source above and it will not longer appears.

Chris
 
Hmm, I don't recall the exact syntax but it is possible to include the password in the Connection String.

Try this (with appropriate substitutions):
Code:
DataEnvironment.Connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
        & "Data Source=" & App.Path & " /Datenbank.mdb;" _
        & "User Id=[b][i]UserName[/i][/b];" _
        & "Password=[b][i]Password[/i][/b]"
 
Another thing you might try is passing username and passoword to the .Open method:

Code:
DataEnvironment.Connection.Open , ,[b]UserName[/b], [b]Password[/b]

In the line above I ommitted the first argument because it is ConnectionString and it was already set so I do not believe that it has to be passed again (I may be wrong on this point.)

Perhaps you could combine it all into a single statement:
Code:
....Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
        & "Data Source=" & App.Path & " /Datenbank.mdb;" , _
        [b]UserName[/b], _
        [b]Password[/b]

Also I think it is possible to set a password on the MDB file itself. If this is your scenario then the connection string should be modified to include:
Jet OLEDB:MDB File Password
 
Dear all
Now I know why this App-def Obj-def error i got.
Wrong path in the Application! First solution is include the mdb File into the Package & Deployment Wizard thanks Sheco for help.
Secound I found that my Software is looking in the WinPath like C:\Windows\System32
and there is something wrong because when you have an english version of Windows or a Windows NT installation its have a Directory named C:\WINNT and the Program Files Directory calls Programme Germen / English setting of the Installation from Windows XP / 2000 / NT ...
If i create this missig Directories an include the dll's from the setup its working very well.
It will be very kindly if have somebody Time to have a look on this German / English setting Problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top