User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 25 Mar 2004, 11:39   #1
Minty
Who?
 
Minty's Avatar
 
Join Date: Sep 2001
Location: #Comfy
Posts: 743
Minty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant future
Access & Visual Basic

I am trying to change the path of a Access file I have.
It has a bit of VB integrated into it and the part that sticks out the most to me in relation to this is

Code:
If strPathToDataFile <> "" Then
        
        DoCmd.SetWarnings False
        DoCmd.RunSQL "DELETE * FROM UserList;"
        DoCmd.SetWarnings True
        
        Set db = CurrentDb
        Set rst = db.OpenRecordset("UserList", dbOpenDynaset)
        
        conn.Provider = "Microsoft.Jet.OLEDB.4.0"
        conn.Open "Data Source=" & strPathToDataFile
Can anyone help me
When I run the whole of the code it is telling me that "\\server-03\blah\etc" is an invalid path.
I somehow need to get Access to look at another file rather than the old one.

Can anyone help point me in the right direction?

Thanks

Dan
__________________
#cnuts
For all your homoerotic needs


<Bobzy> Minty, you have a line for everything
<Queen> MINTY ROCKS
<Ice-Lady> minty is a odd boy
<Game> Minty rocks
<Queen> no minty..cos u rock
<HobbieRogue4> Minty, you stone!
Minty is offline   Reply With Quote
Unread 25 Mar 2004, 13:42   #2
Raging.Retard
Street Tramp
 
Raging.Retard's Avatar
 
Join Date: Apr 2000
Location: Street Gutter
Posts: 341
Raging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant future
Re: Access & Visual Basic

Find out whats setting 'strPathToDataFile' ... then change it to something else (ie. the correct path).

That code seems odd to me though ... why would you use Access, to talk to an ODBC driver, to talk back to the same access DB you are calling from?
__________________
Chimney Pots.
Raging.Retard is offline   Reply With Quote
Unread 25 Mar 2004, 13:46   #3
Minty
Who?
 
Minty's Avatar
 
Join Date: Sep 2001
Location: #Comfy
Posts: 743
Minty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant future
Re: Access & Visual Basic

You're asking me? I am just the n00b who has been asked to link it in with another file.

How do I find out whats setting 'strPathToDataFile' then?
I had a look before I posted here and i still won't have a clue

I am most grateful for any help.

Ta
__________________
#cnuts
For all your homoerotic needs


<Bobzy> Minty, you have a line for everything
<Queen> MINTY ROCKS
<Ice-Lady> minty is a odd boy
<Game> Minty rocks
<Queen> no minty..cos u rock
<HobbieRogue4> Minty, you stone!
Minty is offline   Reply With Quote
Unread 25 Mar 2004, 13:51   #4
Minty
Who?
 
Minty's Avatar
 
Join Date: Sep 2001
Location: #Comfy
Posts: 743
Minty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant futureMinty has a brilliant future
Re: Access & Visual Basic

I believe I have done it.

Nevermind

Thanks
__________________
#cnuts
For all your homoerotic needs


<Bobzy> Minty, you have a line for everything
<Queen> MINTY ROCKS
<Ice-Lady> minty is a odd boy
<Game> Minty rocks
<Queen> no minty..cos u rock
<HobbieRogue4> Minty, you stone!
Minty is offline   Reply With Quote
Unread 25 Mar 2004, 15:43   #5
JetLinus
Friendly geek of GD :-/
 
JetLinus's Avatar
 
Join Date: Nov 2000
Location: On my metal roid
Posts: 923
JetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud of
Arrow Re: Access & Visual Basic

Code:
    strPathToDataFile = Inpubox("Enter Filename:", "Datafile", strPathToDataFile)

    conn.Provider = "Microsoft.Jet.OLEDB.4.0"
    ...
Insert the line above to be asked for a filename input!
__________________
[»] Entropy increases! :-/
JetLinus is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 14:50.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018