-
Jan 3rd, 2014, 01:20 AM
#1
Thread Starter
Junior Member
Connection.execute querry not saving the data in database.
Dear Sir,
i am putting some data in the database through vb application through below qeurrry.
connection.execute("delete from table where ID = 'ABC' ")
qurry works fine and i can see the correct results. but when i close and run again this application, it appears that above querry has not saved the result or has not updated the database.
Point to be noted, database is of SQL 2008, and database resides in another computer machine whithin the network.
please help.
Thanks and best regards.
Imran Khaldi
-
Jan 3rd, 2014, 07:13 AM
#2
Re: Connection.execute querry not saving the data in database.
Moved From The CodeBank (which is for sharing code rather than posting questions )
-
Jan 3rd, 2014, 07:24 AM
#3
Re: Connection.execute querry not saving the data in database.
This is almost certainly due the settings for the database in your project. You're database is being copied every time you run your project and your delete is being performed on the copy, not the original. When you finish running the copy is discarded and your changes are lost. Have a look round for a member called JMcIllhiney. I'm pretty sure he's got a link in his signiature which explains it very well and tells you how to fix the problem.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Jan 3rd, 2014, 07:27 AM
#4
Re: Connection.execute querry not saving the data in database.
here you go. I found the link for you. The forums being a bit glitchy at the moment so I can't post it as a link but here's the url.
http://msdn.microsoft.com/en-us/libr...89(VS.80).aspx
OK, it interpreted the url automatically, nice.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Jan 3rd, 2014, 07:56 AM
#5
Re: Connection.execute querry not saving the data in database.
Hmmmm Funky read something different from me...
while his assessment jives with my initial reaction.... this bit:
database is of SQL 2008, and database resides in another computer machine whithin the network.
Seems to indicate a SQL Server sistuation... and not necessarily a local files issue... I could be wrong though.
That said... I NEVER... EVER, use the connection.execute that way... personally I think it's more prudent and better to create a connection, create a command, create parameters as necessary, and then execute the COMMAND...
-tg
-
Jan 3rd, 2014, 07:59 AM
#6
Re: Connection.execute querry not saving the data in database.
Seems to indicate a SQL Server sistuation
Ooh, actually you're probably right. I clearly wasn't paying attention.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Jan 3rd, 2014, 08:07 AM
#7
Re: Connection.execute querry not saving the data in database.
Is your application written in VB6 or VB.NET? You appear to be using ADO so that would suggest VB6, although it would work in VB.NET too.
-
Jan 4th, 2014, 01:32 AM
#8
Thread Starter
Junior Member
Re: Connection.execute querry not saving the data in database.
thanks for your openion but i am still unable to resolve the matter.
for you reference i am using quetty as under.
============
dim insertquerry as stringg
insertquerry= "insert into customer values ('name', 'id', 'address')"
connection.execute(inserquerry)
===========
waiting for further help to resolve the matter.
Thanks and best regards.
-
Jan 4th, 2014, 01:33 AM
#9
Thread Starter
Junior Member
Re: Connection.execute querry not saving the data in database.
thanks for your openion but i am still unable to resolve the matter.
for you reference i am using quetty as under.
============
dim insertquerry as stringg
insertquerry= "insert into customer values ('name', 'id', 'address')"
connection.execute(inserquerry)
===========
waiting for further help to resolve the matter.
Thanks and best regards.
-
Jan 4th, 2014, 09:27 AM
#10
Re: Connection.execute querry not saving the data in database.
We're none of us going to get very much further if you don't indicate how you're setting up the connection and, more importantly, demonstrate that you are opening the connection prior to the command. You won't necessarily get an error if you execute a command on a connection that is closed but it certainly won't do what you want it to.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jan 4th, 2014, 08:58 PM
#11
Re: Connection.execute querry not saving the data in database.
I'm still waiting for an answer to my question too:
Originally Posted by jmcilhinney
Is your application written in VB6 or VB.NET? You appear to be using ADO so that would suggest VB6, although it would work in VB.NET too.
You say that you're waiting for further help but you refuse to provide information that we've requested in order to help you. Is your time inherently more valuable than ours?
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
|