Thread: Database programing in MS Visual

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    32

    Question Database programing in MS Visual

    I am teaching myself database programing, and so far I've got the code worked out, except when I execute I don't get the info correctly from the db, I get the last column's settings only, when I go back to review the db, the program has changed all the columns in my db to the last columns informations. Yet nothing in my built in SQL statement suggests that should happen.

    As I move through the next and previous records therefore I only the same info....

    Does this problem sound familiar to anyone? I'm sure its something to do with the way I designed the program to interface with the db, but I am not sure what, I simply followed the examples in the book I bought to setup the pre-designed code in MSVisual 6.0.

    I would insert some code clips, but last time I had an issue working out the code tags and really ticked some people off....

    Any hints as to where I might isolate my problem.....????
    I'd like to put Murphy and his laws in headlock sometimes!

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    What framework are you using for datbase communication(CRecordset/SQL functions/other)?

    By Execute, do you mean opening a recordset?

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    32
    The framework is using CRecordSet, which I rename to something useful to my code for practical naming, at the point of setting up the workspace I renamed CRecordSet to CPartnerSet.

    I allowed it to use the standard code it inserts with a generic
    "SELECT * FROM TABLE" sql statement, which is

    ("SELECT * FROM Partner")

    I've gone as far as to changing the sql statement to ensure it is finding the appropriate record, and it is. It simply does not display the data in the proper edit boxes. It only displays the last fields information which is department and it updates my db to the departments field information for all my fields.

    That leads me to think it has something to do with the built in propset that gets included in the pre-designed code where my SQL statement gets read.

    But as for my edit boxes not displaying the information except for the first box, I've checked all my variable and relations to the specific class and variables within and can not figure why it is not inserting the proper variable information in the proper edit box.
    I'd like to put Murphy and his laws in headlock sometimes!

  4. #4
    Registered User
    Join Date
    Feb 2003
    Posts
    34
    Try and post some more code

    Perhaps check the design of your table in the db for compatibilty with your SQL statement.

    If you are inserting you may want to use"insert into" after opening with the rs.

    Try to write a record after it is retreived ,will indicate that the record was retreived properly

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    32
    I finally found my mistake, it was an error on how I setup the View class, I accidentally added a class that was not necessary and had removed the appropraite view class. This caused my variables not to be fed to the Dialog variables to display. Then I had to modify the variable types that MS Visual assigned and the DBType variable that was being loaded by MS Visual.

    Thanks for the pointers, I'm sure I'm going to need more help as move further into this visual aspect.
    I'd like to put Murphy and his laws in headlock sometimes!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error connecting from Dev C++ to MS Access Database
    By Sridar in forum C++ Programming
    Replies: 0
    Last Post: 04-15-2006, 06:09 PM
  2. header file bringing errors?
    By bluehead in forum Windows Programming
    Replies: 4
    Last Post: 08-19-2003, 12:51 PM
  3. Visual Age C++ to MS VC++ conversion issues?
    By Ruchikar in forum Windows Programming
    Replies: 3
    Last Post: 08-10-2003, 09:54 PM
  4. MS Visual Studio 6.0
    By overspray in forum Windows Programming
    Replies: 2
    Last Post: 07-26-2003, 06:56 PM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 05:27 AM