Solved

SQLConnect question...

Posted on 2002-06-05
3
851 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

726 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