472,143 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

VB6 Adodc not working on other PC

104 100+
Hi all, got a problem that is driving me insane, have tried everything and wondering what I am missing. Have a adodc connection to a mdb. On the development PC the database reads perfectly to the text boxes. Soon as I compile the project and run on another machine it does not populate the text boxes and previous / next command buttons don't work either. Yet if I open the exe from the "design pc" across the network it reads perfectly?????? No error message while in design mode or in compiled mode on other pc. The text boxes have been set in their properties. Please could anyone advise as to what they think the problem might be?

Herewith my code to call the mdb on form open:
Expand|Select|Wrap|Line Numbers
  1. SalAdodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\Data\Sal.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False;Mode=ReadWrite|Share Deny None;Persist Security Info=False"
  2.     SalAdodc1.RecordSource = "SELECT * FROM Table1"
  3.     SalAdodc1.Refresh
  4.     If Not SalAdodc1.Recordset.EOF Then SalAdodc1.Recordset.MoveFirst
  7. SalAdodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\Data\Sal.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False;Mode=ReadWrite|Share Deny None;Persist Security Info=False"
  8.     SalAdodc2.RecordSource = "SELECT * FROM Staff"
  9.     SalAdodc2.Refresh
  10.     If Not SalAdodc2.Recordset.EOF Then SalAdodc2.Recordset.MoveFirst

Have added this code in to see if it will not help with no luck
Expand|Select|Wrap|Line Numbers
  1.     Set Text21.DataSource = SalAdodc2
  2.     Set Text22.DataSource = SalAdodc2
  3.     Set Text23.DataSource = SalAdodc2
Apr 15 '09 #1
12 4920
104 100+
Does no one know what the problem might be?
Apr 15 '09 #2
639 Expert 512MB

Just one thought, does the connection string 'App.Path' apply to both PCs??

Apr 16 '09 #3
104 100+
Hi, the app.path is directed at the host pc (but also works across network). When software installed on a pc all mdb etc installed with it. So in effect a clone. I have other mdb links within same project on other forms and functions that work no hassle to host and across network. Just this one that will not work when I entire program to other pc. On development pc it works fine????? got me baffled beyond belief. Any Ideas would be apprciated.
Apr 16 '09 #4
104 100+
Just as a matter of interest, I have copied the database connection code within the same project from another point to this form. Just changed the name to the new MDB and set text boxes up for new mdb. So no reason why it should not work??
Apr 16 '09 #5
487 Expert 256MB
Is your project a multiuser system?
If Yes, Then you should change
Apr 17 '09 #6
104 100+
No, just can run through network to access app. It is a clone, basically each client has a copy with their data in it. On development pc database works perfectly. install program on any other pc and won't "read" database, yet paths are correct and installed mdb on pc. Even went and deleted mdb on other pc and ran software which gave error in locating database. (which was great, means it sees mdb) yet won't show in Textboxes, when mdb was put back on pc.
Apr 17 '09 #7
487 Expert 256MB
I Think your system(Project) is multiuser interface and you are making it more complicated by cloning Database. My suggestion is never do cloning.
Apr 17 '09 #8
104 100+
Ok, could you just eloborate on how you define cloning. I used one of the other databases that work, deleted the tables and put new tables in for new form. Would you say that is cloning? Ok, will try redo the database from scratch and and see if that works. Thanks for the idea, will let you know if it works (holding big thumbs!!!)
Apr 17 '09 #9
487 Expert 256MB
Is this your project structure?
Attached Images
File Type: jpg untitled.jpg (9.7 KB, 422 views)
Apr 17 '09 #10
104 100+
No, One exe file, couple of mdb's reading only to that one exe.
Apr 17 '09 #11
104 100+
I assume system meaning diff PC's? No exe and mdb's on one pc, can access from diff pc's and open 1 instance as and when diff people need too. But even so, most clients just have it on one pc. Mdb not reading there on standalone.No network or anything..
Apr 17 '09 #12
104 100+
I did a new mdb from scratch and tried that and still same result, won't read on another pc?
Apr 20 '09 #13

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Raoul Watson | last post: by
2 posts views Thread by Wernerh | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.