Currently I'm connecting to several SQL and Oracle db's.
In order to do this, I've added the Data Sources to the
PC that I'm working on, and then linked the tables. I
would like to port this application to other PC's, but I
don't want to have to set up the data sources for each db.
Can I create the connection with VB? Does someone have
some source code they are willing to share that could
show me how to do this.
Thank you.
Mark
Hi, Mark.
You don't have to use a DSN for your database connections, but they're
easier to manage, and your applications will be easier to maintain if you
use DSN's. And you don't have to manually set up the DSN's on the other
computers. To save time, you can programmatically create DSN's on
individual computers.
For an example of building a system DSN:
http://support.microsoft.com/default.aspx?scid=287668
For an example of building a user DSN or file DSN:
http://support.microsoft.com/default.aspx?scid=159691
For an example of programmatically changing the database in a DSN for SQL
Server that uses a trusted connection:
http://support.microsoft.com/default.aspx?scid=316752
If you're bent on using VB instead of DSN's for your connections, then you
should look here for sample code for ADO Connections and Recordsets:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdco
nmakingaconnection.asp?frame=true
For DSN and DSN-less ADO connection string examples for SQL Server, Oracle
and many other RDBMS's, check here:
http://www.able-consulting.com/ado_conn.htm
HTH.
Gunny
See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.
> Currently I'm connecting to several SQL and Oracle db's.
> In order to do this, I've added the Data Sources to the
[quoted text clipped - 9 lines]
>
> Mark