Solved

SQLConnect question...

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

759 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

21 Experts available now in Live!

Get 1:1 Help Now