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.
kyriakos70Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnjcesCommented:
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
Geert GOracle dbaCommented:
when you monitor the sql server with profiler do you actually see the statements for the deletes or updates ?
kyriakos70Author Commented:
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?

Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

kyriakos70Author Commented:
Hello,
No I don't see them.
kyriakos70Author Commented:
I am getting something like exec unprepare no delete statement
kyriakos70Author Commented:
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.
kyriakos70Author Commented:
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
JohnjcesCommented:
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
kyriakos70Author Commented:
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.
JohnjcesCommented:
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
JohnjcesCommented:
To enable SQl Server 2005 make certain that you:


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

John
kyriakos70Author Commented:
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
JohnjcesCommented:
http://support.microsoft.com/kb/914277

Here you go!

For ADO you do not need the native SQL Client.

John
kyriakos70Author Commented:
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
JohnjcesCommented:
You never want to connect to an SQL Server via the INternet. It is a security issue that will bite you big time! I do not recommend it.

However, here you substitute your public or Internet IP for your local IP AND you must open port 1433 and I think 1434 and/or port forward those to your SQL Server.

I would never do this! Just another warning!

John

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kyriakos70Author Commented:
OK,
Thank you again.

Kyriakos
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.