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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 DataSource Data Source MS Jet OLE DB Initialization Information 2

Status
Not open for further replies.

PWD

Technical User
Joined
Jul 12, 2002
Messages
823
Location
GB
Good afternoon. Sometimes I'm a bit thick - now is one of those times. I've inherited a VB6 project and have almost figured out most of it. What I don't get is where the location for the data is set. When my (ex) colleague created the program, his 'K' drive was obviously mapped to where the .mdb resides. Mine isn't, so when I run it I have to type the correct path in the 'Please enter MS Jet OLE DB Initialization Information' window. There's nothing in the code that sets this at run time. I've searched high & low - maybe I've been looking for the wrong thing. Can anyone help me, please?
Des.
 
Is there a DataEnvironment in the program?

An even more odd question: how did you determine that it was on his K-drive?
 
It would be helpful to know whether this is DAO or ADO, though it sounds like ADO.

There must be a connection string set someplace. Otherwise how would it even know it is to use the Jet Provider?

Thangs like the ADO Data Control can have this set in a design time property, and so you won't see it in the code anywhere.

The connection string can even be minimal, just enough to reference a UDL, DSN, or cause ADO to prompt for the full definition. Usually the latter requires at least a Provider to be defined first or you get a more generic prompt dialog asking for the Data Source.

Even with a full connection string you might get the prompt though if the Data Source specified can't be found.

Somewhere in that program you ought to see the text "Microsoft.Jet.OLEDB.4.0" or something similar.
 
Hi GhostWolf. That’s a negative for DataEnvironment. When I ‘F8’ step through the program the first thing that happens is the 'Please enter MS Jet OLE DB Initialization Information' window pops up. ‘DatCource:’ is populated with K:\InetPub\ ‘User Name:’ = Admin; ‘Password:’ is blank, so is ‘Provider String:’; ‘Open Mode:’ = DB_MODE_READWRITE. If I change the ‘K’ to an ‘X’ (where my InetPub\ is mapped, then the program runs, If I don’t then I get a Run-time error ‘-2147220992 (80040200)’:
‘K:\InetPub\ is not a valid path.

Hi dilettante. I don’t know the difference between DAO & ADO. I’ve search the whole project for ‘Jet’ and nothing. There’s no Data Control form either. This is just driving me nuts!!!

These are the first few lines of

Public Function Startup(strFoldername, j, Catch)
Dim File

Set fso = CreateObject("Scripting.FileSystemObject")

intmaxrecords = deEbusiness.rscopartner.RecordCount
deEbusiness.rscopartner.MoveFirst

if that’s any clue?

Many thanks, Des.
 
What is deEbusiness declared as and where in your code are it's properties set (that'd be a good place to start looking)?

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Hi HarleyQuinn. Sounds logical. Strange, 'deEbusiness' is not declared anywhere! This is the first place it appears.

Aaaarghhhh!

Des.
 
If you right click on deEbusiness and click Definition, what happens?

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
It's sitting there under the 'Designers' in the Project window. In the main window it shows:-

deEbusiness
DEConnection
SQL copartner
Then all the table's column header names.

Any help?

Des.
 
There ya go! Right-click either "DEConnection" or "SQL copartner", then click Properties.
 
Excellent! EXCELLENT!!!!!!!

Dude.

Sweet.

I'll certainly remember that one.

Microsoft Data Link
'Test connection succeeded'

Many thanks,
Des.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top