Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding records to different tables of a database using a tabbed dialog

Status
Not open for further replies.

yllatys

Programmer
Dec 31, 2000
1
GB
I am using Visual C++ and need to input information into a database, using ODBC. The data is to be entered through a tabbed dialog box, with each property page corresponding to a table in the database. The AddNew() function cannot be used since this does not work with bound tables. I have tried using SQLSetPos without success and creating record sets for each table/page produces an Access Violation
Error when performing any operation on those record sets.

Can anyone help?
 
> The AddNew() function

Can you be more specific?

> does not work with bound tables.

Can you use a SQL INSERT statement?

-pete
 
I guess "addnew" refers to the MFC provided functions in the CDatabase/CRecordset classes.
My guess for yr problem would be that do not bound yr controls to the database tables. SQL Insert should work straight away if you properly take care of all the relations in the database.

Hope this helps
Sriks
 
Could one of you tell me where I can get an example of using Property Pages to display/edit database info through an ODBC connection?

I created an app that worked using a single dialog, but errors out after converting it to a tabbed dialog format. I can't figure out how to get the database info into my 3 pages' edit boxes.

I've posted this question before and have gotten some examples using OLE, but I'm new at this and I don't understand it. I'm fairly good at ODBC connections and just came across your postings today.

Any help would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top