How to retrieve the DSN name from VBA in MS Access

D

dockwingleong

Is this even possible, retrieve the DSN name from VBA in MS Access?
Any sample code, suggestions are appreciated. I thought about reading
the registry but couldn't find a function to do that in Access VBA.

Is it possible to execute a VBScript from VBA?

Thanks,
-Dock
 
D

dockwingleong

Just to be clear, I am trying to retrieve the SQL Server name in Access
VBA. This is simple in SQL Analyzer, select @@servername, but Access
doesn't like this. The last resort for me is to use Windows APIs to
read from the registry. But hate to use Win APIs unless I really need
to.

-Dock
 
D

dockwingleong

I finally used Windows Scripting Host inside VBA to retrieve the SQL
Server name from the registry, very easy and simple compare to any of
the previous thoughts.

Thanks,
-Dock
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top