Results 1 to 4 of 4

Thread: Adding data to a database

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    5

    Adding data to a database

    The answer to this 1 is probably pretty basic. Im trying to add data to a database with VB using adodc connection, but when i created my database originally, some attribute names had spaces in then, i.e. "infra red" was the name of an attribute. How do i add data to this. Ive got

    Adodc1.Recordset!infra red = Combo3.Text

    but because there is a space VB doesnt like this. And i cant really change the names of the attributes. Does any1 know if there a way round it?

    Thanks

    Will

  2. #2
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313

    Re: Adding data to a database

    Try square brackets:
    VB Code:
    1. Adodc1.Recordset![infra red] = Combo3.Text

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    5

    Re: Adding data to a database

    Hmm well that seems to have done the trick, thanks a lot for that, however it didnt actually add the item to my database.lol

    im sure thats something ive missed so i'll look into it, but it found the attributes ok so cheers pal.

    Will

  4. #4
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313

    Re: Adding data to a database

    Are you doing an edit/update?
    Something like this:
    VB Code:
    1. Adodc1.Recordset.Edit
    2. 'do stuff here
    3. Adodc1.Recordset![infra red] = Combo3.Text
    4. '....
    5. Adodc1.Recordset.Update

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