Archived

This topic is now archived and is closed to further replies.

lackluster

ODBC is fun

Recommended Posts

lackluster    122
How can I connect to a specified server (via server name or IP address) to access a database? I could only find methods to access a DSN which is not what I''m looking for. Something like the SQLDriverConnect() API would be nice, with a pre-defined dialog box and all, but with the ability to choose/specify a server.

Share this post


Link to post
Share on other sites
Cyberdrek    100
quote:
Original post by lackluster
How can I connect to a specified server (via server name or IP address) to access a database? I could only find methods to access a DSN which is not what I'm looking for. Something like the SQLDriverConnect() API would be nice, with a pre-defined dialog box and all, but with the ability to choose/specify a server.


I'm not sure if there is a function to do that in C or C++ but if you're making a website, PHP has Native SQL drivers compile in it...


Cyberdrek
cyberdrek@gdnmail.net
Founder Laval Linux

/(bb|[^b]{2})/ that is the Question -- ThinkGeek.com
Hash Bang Slash bin Slash Bash -- #!/bin/bash

[edited by - cyberdrek on March 17, 2002 3:15:57 PM]

Share this post


Link to post
Share on other sites
lackluster    122
I need compatability with at least three different databases. My targets are SQL Server, MySQL, and Oracle. I am most likely incorrect here, but isn''t ODBC the answer to this? That''s the only reason I chose ODBC.

Share this post


Link to post
Share on other sites
Ozz    122
Lookup ADO (ActiveX Data Objects) on the MSDN, it's a nice High Level OO API built on top of ODBC. You can use a subset of ADO called RDS (remote data services) to access remote servers.


Eoin.

[edited by - Ozz on March 17, 2002 5:21:33 PM]

Share this post


Link to post
Share on other sites
lackluster    122
quote:
Original post by Cyberdrek
I''m not sure if there is a function to do that in C or C++ but if you''re making a website, PHP has Native SQL drivers compile in it...



Nah, I''m not making a website, I''m making a Query Analizer. I know about PHP though, it''s my favorite web script language. Unfortantly, we don''t get to use it at work . We have to work with Cold Fusion & ASP.

This simple project is getting increasingly difficult having to learn RichEdit & ADO (in a non-wussy context like in ASP). Anyways, thanks for the replys. If anyone else has a good ADO tutorial to lend (besides the ones @ MSDN), that would be a grand help.

Share this post


Link to post
Share on other sites
Taulin    100
If you have the right ODBC driver installed, you should be able to use the correct connect string.

An example of connecting to a PostgreSQL would be

"Driver={PostgreSQL};Server=;Database=;"

Of course there is other data like login name and password that can go at the end. If you do a search somewhere on ODBC, there are a lot of sites that give more information.

Share this post


Link to post
Share on other sites