Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connecting visual basic to remote oracle server

Status
Not open for further replies.

hoasca

Programmer
Jun 25, 2003
1
BR
hi all.

I need a ADODB string to connect a visual basic application to a remote oracle database. Can someone help me?
 
Hoasca,
A really good (generic) way to figure out the syntax of connection strings is to just drop an ADODC (ADO Data Control) on your form, then use the built-in wizard to make a connection to your data source.

Once you've done that, you can just copy the connection string from the properties window, an paste it into your code then delete the ADODC.

At least that's what we do around here.

Tranman
 
hi,
you can biuld a connection string from adodc, properties- connect by string wizard, and you can cut copy this string in adodb.
Satya
 
you can either connect using a dsn or without dsn.

dsn-less connection is

Set conn = New adodb.Connection
Let conn.ConnectionString = "Driver={Microsoft ODBC for Oracle};server=myservername;Uid=myuid";Pwd=mypwd"
conn.Open

Set rs1 = New adodb.Recordset
rs1.Open "select * from mytable", conn, adOpenDynamic, adLockOptimistic


myservername = the host string you use to connect to oracle server thru sql*plus.
uid = oracle sql*plus user name
pwd = oracle sql* plus password



for dsn connection you need to first create a system dsn thru the ODBC data sources in the control panel. suppose the created dsn is "mydsn", the connection string becomes

Set conn = New adodb.Connection
Let conn.ConnectionString = "dsn=mydsn;Uid=myuid";Pwd=mypwd"
conn.Open

if it's not clear, i'll give more details

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top