Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VB5 (possibly 6) and MS Access Linked table problem

Options
  • 25-05-2009 10:17pm
    #1
    Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭


    I have a database that I need to network. It is the backend to a VB5 (or possibly 6) GUI.
    Currently the GUI looks for the database (through the code) in a folder on the users C: drive but as I need to make it available to a number of users, and it needs to be backed up, I figured the obvious move - stick it on the network.

    However, the path within the GUI is fixed so I tried putting the original up on the network and creating another with linked tables on the C: drive. However, I'm now getting an error ("3219 - Invalid Operation") seemingly caused because the VB code is using adOpenTable which doesn't work with linked tables (need adOpenDynaset). I can view data but not update, etc.

    I have managed to get hold of some of the original VB files but not enough to rebuild the project so I think this option is out the window. I have the install files (.exe and cab files) but IIRC you can't really reverse engineer a VB project properly.
    I tried using a shortcut to the DB but that doesn't work and I'm running out of both ideas and patience.

    Can anyone think of an idea?


Comments

  • Closed Accounts Posts: 5,096 ✭✭✭--amadeus--


    I've managed to forget pretty much everything I learned about networking but can't you do a virtual mapping so that a network location appears as if it's local? You could do that for whatever the host directory is


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    Thanks for the reply.
    Do you mean to simply map the network drive?
    The VB app is specifically looking for C:\foo\myDB.mdb


  • Closed Accounts Posts: 5,096 ✭✭✭--amadeus--


    You could just remap all the users drives so that c: pointed to the network but thats not a great solution!

    I'm 99% certain that one of teh courses I took for an MCP involved mounting a network drive so that it looked just like a regular directory. If I am remembering it rightly then the location "foo" on your C:\\ would actually be off on your server somewhere. But Google (or my memory) is failing me. And I might be mixing up some Linux as well, it's 5 or 6 years ago I was doing this stuff. Maybe try the SUBST command as well?


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    You could do the following

    http://www.computerhope.com/substhlp.htm

    Use subst to effectively mount the network drive as a local folder on the disk

    mybe if I RTFM
    Note: You cannot subst network drives.


  • Registered Users Posts: 868 ✭✭✭brianmc


    A trick that I've used on Unix platforms many times is to run the binary executable through a text processing program.

    Constant strings such as pathname and so on are often stored in ASCII format within the binary data so using simple text processing tools you can substitute the string for what you require.

    You should not change the length of the data however so if you are replacing a pathname that is 23 characters long, make sure that the new pathname is also 23 characters long.

    In your case it might suffice to change C:\ to an S:\ or similar.

    Worth a shot IMO.


  • Advertisement
  • Registered Users Posts: 2,781 ✭✭✭amen


    did you check and see if it is using DSN string or any reg settings that you could change?

    Or just leave the db where it is and out the app on your new machine and create a network share on the new machines to point to the db on the old machine


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    Cheers guys.
    The application is looking for the database in C:\foo and I have no way of changing that. Were others to make a network share on other machines then I both haven't a proper backup routine (can be resolved) nor will the path be C:\foo\myDB.mdb anymore.

    I can't remap C: to the network as that would bugger everyting else on the PC.

    The only way that I can think of is to mount the networked path as C:\foo. Is this possible/easy? I've googled some examples but so far found nothing clear.


  • Registered Users Posts: 868 ✭✭✭brianmc


    kbannon wrote: »
    Cheers guys.
    The application is looking for the database in C:\foo and I have no way of changing that. Were others to make a network share on other machines then I both haven't a proper backup routine (can be resolved) nor will the path be C:\foo\myDB.mdb anymore.

    I can't remap C: to the network as that would bugger everyting else on the PC.

    The only way that I can think of is to mount the networked path as C:\foo. Is this possible/easy? I've googled some examples but so far found nothing clear.

    If you haven't got suitable text processing tools available, send me a copy of the exe and I can try switching the pathnames for you.


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    Thanks for the offer but I'd say, given the nature of the system that I'd be P45'ed if I did that (even without any data).


  • Registered Users Posts: 868 ✭✭✭brianmc


    kbannon wrote: »
    Thanks for the offer but I'd say, given the nature of the system that I'd be P45'ed if I did that (even without any data).

    NP.

    If you have access to a UNIX system there are any number of tools that you could do this with. I'd probably use sed or vi myself.

    Let me know if you want/need more info.


  • Advertisement
  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    This is single user database that was on one machine used by one user and you want to put it on the network for multiple users. You don't have the source code.

    Wouldn't the correct thing be to greate a new GUI? They are bound to ask you for new features anyway. You may have problems with multiple users with the existing database if it wasn't designed to do that. Who knows what kludges are in there.

    Maybe its a huge sprawling GUI though.


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    Great idea but the next question is whether they are willing or can afford to pay! Its not a massive system but will still cost a few grand!


  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    Of course. But do you want to cobble it together, and perhaps they'll be problems out of your control, because you don't have the source but that you'll be blamed for as you've touched it. Maybe there won'tbe any problems. But I don't think personally I'd touch it unless I could do a fresh GUI. It would take a week, and perhaps a week of tweaking. But then you'd be able to fix everything afterwards and add value with new features easily. I take the point that obviously theres thousands of businesses who limp along with creaking Access databases one click away from disaster but don't have the funds or are unwilling to spend money.


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    I agree but their budget does dictate the way forward and so far I'm being limited to getting the app to recognise the DB on the network.


  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    Fair enough, good luck with it. I can't think of any way to map a network drive so it appears as local drive. I suspect the VB code uses UNC paths. Thats how I'd have done it. Of course I'd have softcoded it and used an ini. Maybe theres some game software for running without a CD that emulate a virtual C drive or VM ware. I wonder how much its costing them to have you wasting time on this route though.


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    I'm assuming (gulp) that the VB code is using C:\foo\myDB.mdb and not a UNC path as this is where the system looks for the DB.


  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    Its just a guess on my part about VB is writing to the db. I could be wrong.


  • Registered Users Posts: 2,781 ✭✭✭amen


    are there any system or user dsn entries ?(
    Control Panel->Admin Tools->Data Sources)

    Why don't you ring the company who wrote code?

    Will you be violating the terms of the license agreement if you put the application on the network?


  • Moderators, Politics Moderators Posts: 39,846 Mod ✭✭✭✭Seth Brundle


    It was a former colleague who developed the system many years ago - source code was last changed for the Y2K thingymabob and ahs since gone AWOL.
    It is not DSN based - all paths are written into the VB code.


  • Registered Users Posts: 1,456 ✭✭✭FSL


    If it's a VB6 exe then the file path will be visible and changeable in the exe. Each character of the string is held in two bytes one is the character e.g. 41 for A the next is 00. You should be able to change the string as long as you don't change the length. If it's any help I have a little utility which will provide a dump of the file. It shows the hex values and the character equivalent for decimal 32 to 126 otherwise it just shows a space. It dumps 32 hex values per line with the offset at the beginning of the line. If it would be of any use to you PM me with an email address and I'll send it to you.


  • Advertisement
  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    kbannon wrote: »
    It was a former colleague who developed the system many years ago - source code was last changed for the Y2K thingymabob and ahs since gone AWOL.
    It is not DSN based - all paths are written into the VB code.

    Bet they spent less on it than a car. If it was a car and 9 yrs old and they used it for their business they'd have no problems paying money to upgrade. Very irritating tbh.


Advertisement