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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection string for oracle 9i

Status
Not open for further replies.

phita

Programmer
Jun 8, 2001
82
0
0
KE
Hi,
I want to create a connection to an oracle database through code. I am able to achieve this using a DSN. Is it possible to create a connection string that refers to the database directly, without using a DSN?
I am using Oracle 9i and VFP7.
This is how I am creating the connection string. It works fine, but when I try to access a view, it opens the "Select Data Source" dialog box.

CREATE CONNECTION myconn ;
CONNSTRING "DBQ=MyDatabase;UID=User;PWD=Password"

Thanks in advance.
 
Phita,

Your approach is basically correct. The actual string you need will be something like this:

"Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=Username;Pwd=asdasd;"

I obtained this information from the excellent website:

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Mike,
Thanks. Let me give this a try.

Thanks again.
 
Thanks,

Based on what you said, I took a closer look at the DSN configuration and discovered a slight difference in the data source name. The computer where the prog was not running had an inappropriate <space> in the data source name. The <space> was not in the data source name on other computers. So when the prog ran on the computer with the <space>, it didn't recognize it.

Obviously, I didn't see the <space> when I made the first comparison of the ODBC setup. :)
 
Sorry, I posted the last comment to the wrong thread -- duh!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top