Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 1st, 2004, 09:06 AM
performance performance is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 8 performance User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 35 sec
Reputation Power: 0
Mysql delphi problem ?? Ado ??

Hi, i´m new around here and have this big problem to solve.
The fact is that i´m using Delphi 7 + Ado + MyODBC 3.51 and Mysql 4.1 and someting strange is happening. The code i´m going to write down works perfectly with SQL Server 2000.

The fact is that if i acessed the same ado query previously it gives me the error "acess violation at address 1F45E7E in module 'msado15.dll'. write of address 01134010 ".

let me explain better: If I change the first ADOQuery for another with a different name, like ADOQtest (and put a adoq test on the form), the code works perfectly, but if i let like it is below, gives that error.

procedure TfrmPrincipal.Button3Click(Sender: TObject);
var ultimo:integer;
begin
with ADOQenvelope do
begin
Close;
sql.Clear;
sql.Add('select * from envelope order by enve_id');
Open;
Last;
ultimo:=ADOQenvelope.fieldbyname('enve_id').asinteger+1;
showmessage(inttostr(ultimo));

end;

with ADOQenvelope do
begin
close;
sql.clear;
sql.add('insert into envelope');
sql.add(' (enve_id,usu_id_envelope, enve_regirregulares,enve_reginformados,enve_regdigitalizados)');
sql.add(' values (:cod,:velope,:irreg,:infor,:digitali)');
Parameters.ParamByName('cod').value:=ultimo;
Parameters.ParamByName('velope').Value:=strtoint(EDusuid.text);
Parameters.ParamByName('irreg').Value:=strtoint(Edregirregu.text);
Parameters.ParamByName('infor').Value:=12;
Parameters.ParamByName('digitali').Value:=12;
ExecSQL;
end;
end;

Seems like i can use a query only one time....And every time i try to do a different "action" with a previously used query, it hangs..

Select works fine, but, if i use this adoquery before just to do a select, like above, it gives that error.

Can someone help me?
It´s a Mysql problem? Ado ?

Reply With Quote
  #2  
Old November 3rd, 2004, 03:59 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Click here for more information.
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,713 Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 11 h 21 m 11 sec
Reputation Power: 1179
Sounds like a MyODBC problem to me. BTW there are some known issues and workarounds. See
http://dev.mysql.com/doc/mysql/en/P...ith_MyODBC.html
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month

Reply With Quote
  #3  
Old November 3rd, 2004, 06:40 AM
performance performance is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 8 performance User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 35 sec
Reputation Power: 0
I solved the problem in a very unusual way...

every time i want to insert data in a database, first i use this:

adoconnect.connected:=false; and then
adoconnect.connected:=true;

.... insert into ....

and works... don´t ask me why !!!!

Reply With Quote
  #4  
Old November 6th, 2005, 09:40 AM
sabarish sabarish is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 1 sabarish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 30 sec
Reputation Power: 0
Smile

INSTEAD OF disconnecting & connecting every time,

try using a ADOCommand Component instead of ADOQuery. It will work fine.

If you disconnect & connect everytime, the operations will become slow.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Mysql delphi problem ?? Ado ??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT