?
Solved

Delphi Multitier can't update or delete

Posted on 2009-04-29
16
Medium Priority
?
445 Views
Last Modified: 2013-11-23
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.
0
Comment
Question by:kyriakos70
  • 9
  • 6
16 Comments
 
LVL 18

Expert Comment

by:Johnjces
ID: 24261026
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
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 24261467
when you monitor the sql server with profiler do you actually see the statements for the deletes or updates ?
0
 

Author Comment

by:kyriakos70
ID: 24261544
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?

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:kyriakos70
ID: 24261676
Hello,
No I don't see them.
0
 

Author Comment

by:kyriakos70
ID: 24261750
I am getting something like exec unprepare no delete statement
0
 

Author Comment

by:kyriakos70
ID: 24261819
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.
0
 

Author Comment

by:kyriakos70
ID: 24262277
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
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 24262301
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
0
 

Author Comment

by:kyriakos70
ID: 24262919
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.
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 24262988
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
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 24263069
To enable SQl Server 2005 make certain that you:


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

John
0
 

Author Comment

by:kyriakos70
ID: 24264549
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
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 24264646
http://support.microsoft.com/kb/914277

Here you go!

For ADO you do not need the native SQL Client.

John
0
 

Author Comment

by:kyriakos70
ID: 24265011
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
0
 
LVL 18

Accepted Solution

by:
Johnjces earned 2000 total points
ID: 24265080
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
0
 

Author Comment

by:kyriakos70
ID: 24265507
OK,
Thank you again.

Kyriakos
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question