|
-
Apr 3rd, 2003, 06:28 PM
#1
Thread Starter
Junior Member
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.
-
Apr 3rd, 2003, 06:47 PM
#2
Frenzied Member
Any code? It is hard to help you without seeing what are you trying to do.
-
Apr 3rd, 2003, 07:48 PM
#3
Thread Starter
Junior Member
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.
-
Apr 3rd, 2003, 08:10 PM
#4
Frenzied Member
Did you ever use a debbuger tool? Step through you code with debbuger and see wzap.
-
Apr 4th, 2003, 03:41 AM
#5
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|