Solved

SQLConnect question...

Posted on 2002-06-05
3
838 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

919 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now