Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

datasnap + unidac example in delphi

Posted on 2011-03-05
24
Medium Priority
?
3,839 Views
Last Modified: 2013-11-23
can someone please provide me a real example of how can I use UniDAC SQLite with DataSnap? I have one GUI Application with a DBGrid and one other app as Server with UniDAC SQLite that connects to a local sqlite file. Let's assume that those two applications are in different machines. So I need to use datasnap to remotely grab data from Server application and display them in the GUI application (DBGrid).

If you have other simplier method to suggest please let me know!
0
Comment
Question by:dinko1
  • 6
  • 4
  • 3
  • +3
17 Comments
 
LVL 19

Expert Comment

by:Thommy
ID: 35043164
Following steps are from Unidac SQLite3.dll...
http://www.devart.com/forums/viewtopic.php?t=14970&sid=e2110564a33fda35dc482476d51b8c7d


1. Drop a TSQLiteUniProvider on a form
2. Drop a TUniConnection onto the form
3. Right hand click on the UniConnection1 and select Connection editor. From the provider dropdown box select SQLite, and then manually enter the path to my database i.e. C:\Program Files\MyAPP\MYProgram\Base.sqb

4. From the Connection editor I select the option tab and enter the following path C:\Program Files\MyAPP\MYProgram for the ClientLirary

5. Change back to the connect tab, and click on the Connect button, which is now rasing the following error Connection ClientLibrary differs from already active Connections.

6. Leaving the ClientLirary blank for the option tab raises the following error cannot load client DLL: sqlite3.dll
Any ideas
0
 
LVL 19

Expert Comment

by:Thommy
ID: 35043170
Remember Devart UNIDAC requires the SQLite DLL...
0
 

Author Comment

by:dinko1
ID: 35173722
the solution you provided is just single access to the sqlite file. I asked TCP/IP access between machines.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 24

Expert Comment

by:jimyX
ID: 35291679
Hi dinko1,
It should be simple, once the DB supports the TCP/IP connection. As per the attached screenshot, you can specify the Server and connect easily. But the question is, does SQLite supports the TCP/IP connection?

As you can read in the SQLite documentation Using SQLite on a Network, you are going to rely on the filesystem sharing across the network. In order to enable TCP/IP connection to grab data from Server, either use the suggested solutions:
http://www.realsoftware.com/realserver/
http://atensoft.net/dev/sqlite3.php
...

Or move to another reliable DB like Oracle, SQL Server, MySQL,...etc. that support the TCP/IP connections.
UniConnection.JPG
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35350495
Sorry dinko1,
Have you seen my comment?
0
 

Author Comment

by:dinko1
ID: 35350534
yes Jimmy, and I dont want to move to another server solution.
I already work with MySQL and I have lot of troubles with it. Lots of helpdesk requests, mysql not working, server is down. I have a small project and I need a simply database system.

So, I have to stay with SQLite and make it network (DataSnap).
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35357683
OK I see.

Here is a good DataSnap whitepaper:
http://www.arena.net.au/2010/content/embarcadero/edn/Delphi_2010_WP_DataSnap_091016.pdf

For more materials and learning videos:
http://www.drbob42.com/examines/examinB8.htm
0
 
LVL 46

Expert Comment

by:aikimark
ID: 35357919
@jimyX

This question is scheduled for deletion.  If you want to continue helping dinko1 you should post a comment and click the Object button
0
 

Author Comment

by:dinko1
ID: 35357928
my question is:

an example of UNIDAC + SQLITE + DATASNAP

now white pages on datasnap. I already know how to google and find such info.

thank you anyway.
0
 
LVL 46

Expert Comment

by:aikimark
ID: 35357978
@dinko1

>>If you have other simplier method to suggest please let me know!
I think the problem you might be having with some of the responses is that you invited experts to suggest alternatives in your original question text.

>>an example of UNIDAC + SQLITE + DATASNAP
So, you will only accept an answer if it supplies a coded example (or link to example) that incorporates all three components -- no alternatives allowed?
0
 

Author Comment

by:dinko1
ID: 35358006
i already built my project on UNIDAC + SQLITE and I need to turn this into NETWORK.
I cannot change UNIDAC or SQLITE.
0
 
LVL 46

Expert Comment

by:aikimark
ID: 35358032
@dinko1

I was trying to clarify the question/problem for the other experts and (potentially) future readers.  I can't offer you a solution, but my questions and your responses might help the other experts with their suggestions.
0
 
LVL 24

Accepted Solution

by:
jimyX earned 2000 total points
ID: 35365355
The thing is that I just started the Datasnap in D2009, I used to use MIDAS in D7. So I though giving you the sources that I use would help you as well, anyway I created a small demo for DataSnap + UniDac + SQLite hope it helps.

Steps before starting this project:
At the Server side adjust the UniConnection1 and the UniQuery1 to connect to your local DB and make sure to test the connection and ensure it's successfully connects. In the Server folder add your DB file and the sqlite3.dll.

At the client side adjust the HostName for the "SQLConnection1" at which it should find the Server and make sure the Server is running before opening the Client. As test I set it to the localhost.

For more clarification and extra knowledge you may spend some time reading this sources beside the above whitepage:
http://blogs.embarcadero.com/pawelglowacki/2009/01/20/38649
http://www.drbob42.com/examine/examinA8.htm
UniDac-DataSnap.zip
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35372271
Waiting for a feedback from the author about my last post.
0
 
LVL 24

Expert Comment

by:jimyX
ID: 35408240
In my post #35365355, I have provided a complete example (working demo) which is exactly what the author has requested.
0
 

Expert Comment

by:ModernMatt
ID: 35455407
Lacking further responses from the Author, I am initiating the close procedure to accept jimyX's comment http:#a35365355 as the solution.

jimyX, thank you for going to the effort of coding up and providing a sample solution!

ModernMatt
Experts Exchange Moderator
0
 
LVL 22

Expert Comment

by:senad
ID: 37832284
Unidac has the unidac providers. So depending what your database is drop the adequate unidac provider on the form.
Then on your uniconnection set Providername to your provider. Drop another uniconnectiondialog - and set your uniconnection to use this connectiondialog (Loginprompt=true). This is fairly simple link. Uniconnection will automatically connect.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
What we learned in Webroot's webinar on multi-vector protection.
Six Sigma Control Plans
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

877 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