|
-
August 7th, 2001, 12:33 PM
#1
Connection through coding
how can i connect adodc and oracle database throught coding
plzz help me out
-
August 7th, 2001, 01:09 PM
#2
Re: Connection through coding
Hello
Here is some code that can do it:
private Sub Command2_Click() 'Allow SQL query
Adodc1.RecordSource = "Select " & Text3.Text & _
" from " & Text4.Text & _
" WHERE " & Text5.Text & "=" & Text6.Text
Adodc1.Refresh
End Sub
'This opens Oracle. The user has to input thier userid and password
private Sub Command3_Click()
Adodc1.ConnectionString = "Provider=MSDAORA. 1;Password=" & Text2.Text & ";User ID=" & Text1.Text & ";Persist Security Info=true"
Adodc1.CommandType = adCmdUnknown
End Sub
I hope this will help.
-
August 7th, 2001, 01:53 PM
#3
Re: Connection through coding
This topic has been discussed fairly often in this forum. Please do a search, either on ADODC or DATABASE itself to get the information.
The simples way is to add "Microsoft ADO Data Control x.x" into your project (COMPONENTS). Then add the ADODC component into your form (by default it will be called ADODC1). Right click on it and the wizard will come up for you to build the CONNECTION STRING. You can also use a UDL file or attach via ODBC.
For ORACLE connection, you MUST HAVE the Oracle Client installed on the computer and the TNSNAMES.ORA containing the alias (SERVICE NAME) to the server. The wizard will request for the service name, username and password.
Hope this helps,
-Cool Bizs
Good Luck,
-Cool Bizs
-
August 7th, 2001, 10:39 PM
#4
Re: Connection through coding
Try This,
dim con as Adodb.connection
dim rs as Adodb.recordset
Private Sub Form_Load()
con.connectionstring=uid=YourUsername;pwd=Yourpassword;DSN=YourDsnName;
con.open
rs.open "select *from YourTableName",con,2,3
End Sub
end sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|