Results 1 to 5 of 5

Thread: Weird database problem. please help!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    19

    Weird database problem. please help!

    Hi,
    i'm using ADO for my database project. and i'm aslo using SQL for my record source.
    i have set a text box as a record source. it works fine when i use it but it gives me an error.
    when i use it for SELECT...... it works well. but when i use it for INSERT..... it inserts the data i give to it but then gives me this message : OPERATION IS NOT ALLOWED WHEN THE OBJECT IS CLOSED. and then it closes the application.
    what is this weird thing.
    please help me.
    thank you very much.

  2. #2
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Any code? It is hard to help you without seeing what are you trying to do.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    19
    OK,
    i have an ADO contro and a data grid control and a text box with a command button.
    i connected the ADO with the grid and set the text1.text to be the adodc1.recordsource . and for the button i put in this code :

    Private Sub Command1_Click()
    Adodc1.RecordSource = Text1.Text
    Adodc1.Refresh
    End Sub


    then when i type in for example :
    INSERT INTO sign (username) values ('mike')

    it enters the data correctly in to the database , but it also gives me that error and closes the application.
    I hope you can help.



  4. #4
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Did you ever use a debbuger tool? Step through you code with debbuger and see wzap.

  5. #5
    Hyperactive Member JMvVliet's Avatar
    Join Date
    May 2001
    Location
    Papendrecht, Netherlands
    Posts
    310
    Sounds something like this:

    You've connected a grid to your recordset. All works fine, when using select statements. But, when you use a insert statement, there is no recordset returned, so the grid can't be bound to it. I think herein lies the problem.

    good luck.

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