Solved

how to connect to a remote sql server...

Posted on 2000-04-30
5
230 Views
Last Modified: 2010-04-02
I need access to a msql server on remote systems that will access tables and edit them. If this is possible can you show me how and possibly some sample code sorry i only have 5 points ;(
0
Comment
Question by:beyonddeath
[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
  • 2
5 Comments
 

Expert Comment

by:jonasb
ID: 2765706
m_pDB = new CDatabase;

//TRy to connact to DB
if(!m_pDB->Open("Name of ODBCSource))       {
return(FALSE); //Error]
}            
0
 

Accepted Solution

by:
jonasb earned 5 total points
ID: 2765726
Hi
U need to generate a table class for the table U want to change. Easly done with visual studio, just "add class" and inherit from CRecordset. Tell VS the ODBC name and voila..

//h file:

CDatabase* m_pDB
CYourTableClass* m_pTable;

//cpp file:

m_pDB = new CDatabase;
//TRy to connact to DB
if(!m_pDB->Open("Name of ODBCSource"))       {
   return(FALSE); //Error
}            

m_pTable = new CYourTableClass(m_pDB);
if(m_pTable== NULL) return(FALSE);
m_pTable->YourFunction();

That should do it..
0
 

Author Comment

by:beyonddeath
ID: 2766286
does the all work in a console app (im makeing it cgi) Thanks for the help ;)
0
 

Expert Comment

by:jonasb
ID: 2766576
My plesure.. Thanx for the 5 :)
0
 

Author Comment

by:beyonddeath
ID: 2766965
this does work in console mode right

np for the points heeh sorry its not more i dont have ne to give ;)
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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
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.

697 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