Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 24th, 2005, 7:24 AM   #1
Scientist2005
Newbie
 
Join Date: Aug 2005
Posts: 1
Rep Power: 0 Scientist2005 is on a distinguished road
Set a connection to database in TService

Anybody help!!!!!!!!!!!!!
Could anybody exactly explain to me How to create connection to database through ADO or BDE in TServiceApplication or
at least how to execute a query to database with TQuery or TADOQuery.
Don't say that it's only necessesary to execute a procedure CoInitialize(): it doesn't work.
If it's possible, show me the code.

Thanks in advance.
Scientist2005 is offline   Reply With Quote
Old Aug 26th, 2005, 12:35 PM   #2
Scorpions4ever
Programmer
 
Join Date: Jun 2005
Posts: 86
Rep Power: 4 Scorpions4ever is on a distinguished road
It's been a while since I did this, but can't you simply do this:
TDatabase dbConn;

dbConn = TDatabase.Create;
dbConn.Alias := 'Aliasname';
dbConn.DatabaseName := 'dbname';
// Set rest of properties.
dbConn.Connected := true;
Scorpions4ever is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:11 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC