Solved

SQLConnect question...

Posted on 2002-06-05
3
845 Views
Last Modified: 2010-05-18
I am writing a C++ front end for an SQL database ass a school assignment. (Cal State Hayward in California - A Database Architecture class...)

I am having trouble connectuing to the school's SQL database with the SQLConnect function.  Where I supply the database name, I have an IP address for the database, but it's not port number 80, it's a port number in the 1500 range.  (The database also has a short five letter name.)  Specifying the IP address won't let me connect.  How do I specifiy the port number in SQLConnect argument that asks for the database name?  Do I need to provide the database name as well?  

The function parameters are like so:
SQLConnect(hdbc, (SQLCHAR*) "database name (Or IP address)", SQL_NTS,
                           (SQLCHAR*) "username", SQL_NTS,
                           (SQLCHAR*) "password", SQL_NTS);


Confused.  Ack!

Jeff
0
Comment
Question by:Ubercat
3 Comments
 
LVL 1

Accepted Solution

by:
andymurd earned 50 total points
ID: 7078070
Hi Ubercat,

If your using the ODBC function SQLConnect(), the 1st parameter is not an IP address, but the name of a (previously configured) ODBC connection.

On Windows, you configure a connection using the ODBC Administrator found in the control panel. Setting up an ODBC connection will provide a means of specifying the host, port number and database name.

Here's Microsoft's documentation on SQLConnect:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqlconnect.asp

Have fun...
0
 
LVL 11

Expert Comment

by:griessh
ID: 7261502
Dear Ubercat

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "andymurd"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7332887
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question