
Connecting to an oracle database with dao and odbc
Quote:
>Hello, I have been having trouble getting a connection to an oracle database
>as in the subject. All I would like to do is connect to this existing
>database and then I am fine with the rest. I haven't been able to get the
>right syntax. I am using vb 4.0 Enterprise edition, and if someone can give
>me the syntax for these lines, or a pointer to the documentation (I've been
>looking, but have not found the right bit) I would be most appreciative. If
>this is in the FAQ, then I am truly sorry (I don't think it is, but I read that
>before I tried anything with oracle)
>Thank you,
>Carol
The following code will connect you to an Oracle database
Dim mydb as database
Set mydb = Workspaces(0).OpenDatabase("", False,
False,"ODBC;DSN=odbcname;DBQ=TnsNamesName")
For DSN you supply the ODBC name that you created and fro DBQ you
provide the tnsnames.ora name.
David