UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Drop Odbc Dsn With Vba, Access 2000    
 
   
tohas
post Jul 21 2019, 02:37 PM
Post#1



Posts: 66
Joined: 9-July 10



Hi

is there a way to
Drop ODBC DSN with VBA?

Thanks
Go to the top of the page
 
theDBguy
post Jul 21 2019, 02:52 PM
Post#2


Access Wiki and Forums Moderator
Posts: 76,000
Joined: 19-June 07
From: SunnySandyEggo


Depends. If it's a file DSN, you could try deleting it. If it's a system DSN, you'll have to modify the registry.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
GroverParkGeorge
post Jul 21 2019, 03:15 PM
Post#3


UA Admin
Posts: 35,506
Joined: 20-June 02
From: Newcastle, WA


With VBA?

Do you create one with VBA now?

Would you want to replace DSNs from time to time?

Like theDBGuy says, you can use VBA to delete a file, if the DSN is a file DSN. And you can modify the registry if needed using VBA.

However, I'm always curious about the business need for unusual processes like this.
Reason for edit: added code references

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
tohas
post Jul 22 2019, 01:19 AM
Post#4



Posts: 66
Joined: 9-July 10



sorry I forgot to mention that it is a System DSN ceratet with VBA Code.
Go to the top of the page
 
tohas
post Jul 22 2019, 04:34 AM
Post#5



Posts: 66
Joined: 9-July 10



It is well known that I can do this with two reg deletes ..
but I havent any API to do this from VBA.
Go to the top of the page
 
GroverParkGeorge
post Jul 22 2019, 08:24 AM
Post#6


UA Admin
Posts: 35,506
Joined: 20-June 02
From: Newcastle, WA


No API is needed. It can be done with VBA.

So, look into doing it that way.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
GroverParkGeorge
post Jul 22 2019, 09:43 AM
Post#7


UA Admin
Posts: 35,506
Joined: 20-June 02
From: Newcastle, WA


Here's another reference on editing the registry via VBA.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    17th August 2019 - 08:36 PM