Link to home
Start Free TrialLog in
Avatar of kyriakos70
kyriakos70

asked on

Delphi Multitier can't update or delete

Hello,
I have made a multitier client server application in Delphi2006, database sql server 2005. I used datasnap with socket connection and clientdataset, on the server I used adoconnection and adodataset.
My problem is that I can't delete or update records I can only insert, I press the delete button and apply updates but when I reopen the connection the record is still there same with update.
I have test it localy with adoconnection and adodataset and works means the sql server works correct.
Avatar of Johnjces
Johnjces
Flag of United States of America image

Some code of what you are doing/trying to do would be very beneficial!

Is the delete button a basic button with your code or the delete button from the dbNavigator or what?

Lastly, why are you not using ADO on your client app as well? Works both for client PC apps as well as for a locally (running on server) server app.

I would never use any kind of a socket connection for an SQL Server connection. ADO all the way.

John
Avatar of Geert G
when you monitor the sql server with profiler do you actually see the statements for the deletes or updates ?
Avatar of kyriakos70
kyriakos70

ASKER

Hello,
It is a navigation bar button, How can I use ado for multitier on the client side? here is some code, :

procedure TForm19.Button1Click(Sender: TObject);
begin
clientdataset1.ApplyUpdates(-1);
end;

but when I hit it only applies updates for inserting not delete or update.
has something to do with the primary key?

Hello,
No I don't see them.
I am getting something like exec unprepare no delete statement
I believe it works whenever wants, I pressed the delete button after this the apply updates and worked, when I tried to do it again nothing and the delete it appeared in the sql profiler after I get an exec sp_unprepare1 etc.
Johnjces
How can I use ado? I tried with the sqlcli I have entered the local address (127.0.0.1) and showed the sql server does this works for Lan and Internet?

Kyriakos
My apologies... multi-tier went between my ears. In a mult-tier application, connections are different. It has been many years since I last experimented with MT DB apps. All I do is straight client - server with MS SQL using ADO and I just have no problems... well, few problems ! :)

John
How you do it? This way I told you? I have the ado connection and choose from connection string sqlcli 10.0 and entering the ip of the server, this what I have done and worked.
Well, yes it should work for LAN... you just need to enter the SQL Server's IP address into your connection string.

You  must have SQL Server set up for LAN access as they changed default settings for LAN access back in SQL Server 2003 I believe.

If you need that info, I can dig up the link here on EE that I answered on how to do that.

John
To enable SQl Server 2005 make certain that you:


Start the SQL Server Browser Service.
Turn on Named Pipes
Turn on TCP/IP

John
OK give me the link,
I turn on tcp/ip and get an error "sql server not allow remote connections", and tell me how I can access the server through the net, I supose I have to install sql native client to the client pc and access sql server.

Thank you john
Kyriakos
http://support.microsoft.com/kb/914277

Here you go!

For ADO you do not need the native SQL Client.

John
Thank you John,
I will give you the points you covered the question, tell me how to connect with ADO to sql server through internet.

Kyriakos
ASKER CERTIFIED SOLUTION
Avatar of Johnjces
Johnjces
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK,
Thank you again.

Kyriakos