Results 1 to 5 of 5

Thread: saving record to database issue

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2013
    Posts
    1,126

    saving record to database issue

    I have this regular way of saving record to the mysql database which is below:

    rs.AddNew
    rs.Fields("empid") = empid.Text 'save employee id integer type
    rs.Fields("empfp") = FPBlob 'save finger print mediumblob type
    rs.Update

    However, when I do the code above, on the blob data is saved and the employeeid is not saved.
    When, I remove the saving of empfp on that code, the employeeid can now be saved.

    Which means, I cannot save both record on this code.

    What should I do?

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: saving record to database issue

    Is the database auto incrementing the records or are you assigning one manually for each record?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2013
    Posts
    1,126

    Re: saving record to database issue

    no its not incrementing

  4. #4

    Re: saving record to database issue

    Have you tried (just in case of wrong conversion)?
    Code:
    rs.AddNew
    rs.Fields("empid") = Val(empid.Text) 'save employee id integer type
    rs.Fields("empfp") = FPBlob 'save finger print mediumblob type
    rs.Update
    Are you sure that BLOB field is saved?

    BLOB data should go something like:
    Code:
    rs.AddNew
    rs.Fields("empid") = Val(empid.Text) 
    
    rs.Fields("empfp").AppendChunk Null
    rs.Fields("empfp").AppendChunk FPBlob
    
    rs.Update
    Last edited by goranvuc; May 4th, 2014 at 05:05 AM. Reason: additional sample

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    May 2013
    Posts
    1,126

    Re: saving record to database issue

    the saving is ok if done individually but if done both, then only the blob is saved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width