For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > February 2005 > ODBC-Connection









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ODBC-Connection
Nijazi Halimaji

2005-02-23, 8:55 am

Hi

I like to create automaticly a ODBC-Datasource for connecting to a database.
I know that this must be possible but I don't have an idea how to do!

Thanks for every help!

Nijazi Halimaji


JP Bless

2005-02-23, 3:55 pm

Check this out
http://www.able-consulting.com/ADO_Conn.htm

Look at this (Note... air code)


Dim sDSN as string, sDb as String, sUserID as String, sPassword as string,
strConn as String, db as Database

sDSN = YourDsNName

sDb = DatabaseX 'replace with SQL database

sUserID = UseIDX 'Enter user ID

sPassword = PasswordX 'Enter Password

strConn = "ODBC;dsn=" & sDSN & ";database=' & sDb & ";uid=" & sUserID &
";pwd=" & sPassword & ";"

Set db = OpenDatabase("", False, False, strConn)




"Nijazi Halimaji" <spami@gmx.net> wrote in message
news:OOH6VzXGFHA.2180@TK2MSFTNGP10.phx.gbl...
> Hi
>
> I like to create automaticly a ODBC-Datasource for connecting to a

database.
> I know that this must be possible but I don't have an idea how to do!
>
> Thanks for every help!
>
> Nijazi Halimaji
>
>



Paul Clement

2005-02-24, 3:55 pm

On Wed, 23 Feb 2005 08:53:58 +0100, "Nijazi Halimaji" <spami@gmx.net> wrote:

¤ Hi
¤
¤ I like to create automaticly a ODBC-Datasource for connecting to a database.
¤ I know that this must be possible but I don't have an idea how to do!
¤

See the following:

How To Create and Remove a DSN in Visual Basic
http://support.microsoft.com/kb/171146/EN-US/

How To Programmatically Create a DSN for SQL Server with VB
http://support.microsoft.com/defaul...kb;en-us;184608


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
MikeD

2005-02-24, 8:55 pm


"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
news:2v9s1199eu620sph7dp8laa60o28suubng@
4ax.com...
> On Wed, 23 Feb 2005 08:53:58 +0100, "Nijazi Halimaji" <spami@gmx.net>

wrote:
>
> ¤ Hi
> ¤
> ¤ I like to create automaticly a ODBC-Datasource for connecting to a

database.
> ¤ I know that this must be possible but I don't have an idea how to do!
> ¤
>
> See the following:
>
> How To Create and Remove a DSN in Visual Basic
> http://support.microsoft.com/kb/171146/EN-US/
>
> How To Programmatically Create a DSN for SQL Server with VB
> http://support.microsoft.com/defaul...kb;en-us;184608



Even better, use a DSN-less connection string...and even better yet, don't
use ODBC at all.

--
Mike
Microsoft MVP Visual Basic


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com