Results 1 to 8 of 8

Thread: ADODB & MySQL [RESOLVED]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Lithuania
    Posts
    165

    ADODB & MySQL [RESOLVED]

    cn.Execute("Insert Into Table1 Values('value')")

    OK Its vorking.

    How about:

    For a=1 to 100
    cn.Execute("Insert Into Table1 Values('value')")
    next a

    not all 100 values are inserted because of flood

    Question: How to insert all 100 values?
    Last edited by GameBit; Feb 10th, 2003 at 07:39 AM.
    P.S. Sorry for my poor English...

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385
    GameBit,

    What does Table1 look like? How is it defined? Indexes? PrimaryKey?

    I have never used an SQL Insert statement without a field name. I am suprised it works.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Lithuania
    Posts
    165


    Simle table.

    Name |tinytext,Primary,Index,Unique
    P.S. Sorry for my poor English...

  4. #4
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611
    VB Code:
    1. cn.Execute("Update Table1 set tinytext='value'")

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Your code tries to insert 100 records with the same value, while the field only excepts unique values. I guess only the first insert statement succeeds.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Lithuania
    Posts
    165
    Originally posted by Lightning
    VB Code:
    1. cn.Execute("Update Table1 set tinytext='value'")
    Problem not there.
    1. Your code updates record
    2. Even if i want to update 100 records with loop MySQL counts is as flood
    P.S. Sorry for my poor English...

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Lithuania
    Posts
    165
    Originally posted by Frans C
    Your code tries to insert 100 records with the same value, while the field only excepts unique values. I guess only the first insert statement succeeds.
    No. It inserts about 20 of them. Problem not here. I'm talking about how to connect lot of querys to 1 line and only then send it to MySQL
    P.S. Sorry for my poor English...

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Lithuania
    Posts
    165
    OK. I found it mysqlf. Thanx to everyone.
    Answer:

    cn.Execute("Insert Into Table1 Values('value'),('value'),('value')")
    P.S. Sorry for my poor English...

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