Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > Kylix

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2005, 03:06 PM
jamiguel77 jamiguel77 is offline
Senior Member
 
Join Date: Jan 2002
Posts: 1,171
Send a message via MSN to jamiguel77 Send a message via Yahoo to jamiguel77
Default console app delphi/kylix mysql

hi all, i want build a console app but not load windows or xwindows, a friend tell me the only way are linux, see teh kylix/linux code:

vi test.dpr

program test;

begin
writeln('hello world!');
end.

[dl748@dl748 /u]$ dcc test.dpr
Borland Delphi for Linux Version 14.0
Copyright (c) 1983,2001 Borland Software Corporation
test.dpr(6)
7 lines, 0.05 seconds, 12964 bytes code, 1952 bytes data.
[dl748@dl748 /u]$ ./test
hello world!


but how connect in a console app to mysql???

thanks
Reply With Quote
  #2  
Old 08-13-2005, 03:23 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: console app delphi/kylix mysql

Please see links to articles I listed below for tutorials on making Console apps in Delphi.

As for a database console app. Its easy. Because their are no window forms in your app, you have to create your components at runtime and set the properties.

I dont know MYSQL, therefore i will give you an example of a connection to a MS Access database

Example:

var
ADC: TADOConnection


ADC:= TADOConnection.Create(nil);
try
ADC.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;'+
'Data Source=' + ChangeFileEx(Application.ExeName, '.mdb'+
';' +
'Persist Security Info=False';

ADC.Connected:= True;
except
end;

NO GUI Delphi applications

Page 1: Setting up a console mode application with Delphi.

http://delphi.about.com/od/objectpascalide/l/aa091101a.htm


NO GUI Delphi applications

Page 2: A console mode Delphi example; Cosole applications: Tips & Tricks

http://delphi.about.com/od/objectpascalide/l/aa091101b.htm


How to create a Console mode application Without a console window
http://delphi.about.com/od/adptips2005/qt/consolenowindow.htm
Reply With Quote
  #3  
Old 08-13-2005, 03:30 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: console app delphi/kylix mysql

Sorry,

"a friend tell me the only way are linux, see teh kylix/linux code"

Not true, you can use any Delphi version to make a Console application. A Console application is just a no graphical user intrface (NO GUI) application.
Reply With Quote
  #4  
Old 08-13-2005, 03:31 PM
jamiguel77 jamiguel77 is offline
Senior Member
 
Join Date: Jan 2002
Posts: 1,171
Send a message via MSN to jamiguel77 Send a message via Yahoo to jamiguel77
Default RE: console app delphi/kylix mysql

man i want NOT install a WINDOWS or in linux Xwindows, is possible run the app?


thanks
Reply With Quote
  #5  
Old 08-13-2005, 03:52 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: console app delphi/kylix mysql

sorry, i did not understand your last post!
Reply With Quote
  #6  
Old 08-14-2005, 12:46 AM
ciuly ciuly is offline
Senior Member
 
Join Date: Jul 2005
Location: Romania
Posts: 1,037
Send a message via Yahoo to ciuly
Default RE: console app delphi/kylix mysql

I am afraid you are kind of out of luck.

All delphi/kylix components are based on a generic TComponent, which is Windows based (that is, it's using windows stuff; same in linux)

That means that you will not be able to use absolutly any of the components from the delphi palette.

Your only hope is, that you can find:
for delphi
- a tcp/ip driver for Dos
- a set of units that can deal with that tcpo/ip driver
- a set of mysql units that can be used to deal with the mysql DB for dos (from what I know, there aren't any, but you can try searching the web)

for kylix
- I didn't worked with, but the text version of linux has network support, so you might be able to find already implemented in kilyx, or if not, on the web, the necessary support for text ode networking
- you will again need a set of mysql units that can be used in text mode and again I don't have any knoledge of te existance of such units: you will have to search the web

From my point of view, this can be done in kylix, but if you don't find that mysql for text mode support, you will have to get the protocol description from somewhere and implement the hole mysql support yourself, which can be a very hard thing to do: I don't know, just guessing, since I never tryed such a thing. But since there is suport for mysql in text mode linux (see php), I guess there can be some stuff for kylix as well. If not, you can "steal" the mysql support from PHP and convert it to delphi.

Good luck
Reply With Quote
  #7  
Old 08-14-2005, 11:19 AM
jamiguel77 jamiguel77 is offline
Senior Member
 
Join Date: Jan 2002
Posts: 1,171
Send a message via MSN to jamiguel77 Send a message via Yahoo to jamiguel77
Default RE: console app delphi/kylix mysql

the app, need be run in Console App (DOS APP)
Reply With Quote
  #8  
Old 08-14-2005, 12:50 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: console app delphi/kylix mysql

OK, I think i am beginning to understand now. There is a big language barrier here..... and its made worse when you only type two sentences. I have a very hard time trying to decypher exactly what you are trying to say (ASK). Not your fault! Anyway, What I am hearing you ask is

"you want to write an application which will run without Windows (or XWindows) installed on the computer. Correct?

Yes, You will need to write this in Kylix!

Or choose an alternatice language (Java).
Reply With Quote
  #9  
Old 08-14-2005, 12:52 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: console app delphi/kylix mysql

Sorry I meant to say...

No you can't write this in Delphi/Kylix
You will need to choose an alterative language
Example: Java
Reply With Quote
  #10  
Old 08-22-2005, 02:46 PM
Enlighten Enlighten is offline
Senior Member
 
Join Date: May 2002
Posts: 118
Default RE: console app delphi/kylix mysql

it is possible, you just have to be carefull not to use the gui components.

i made an IM server for cli using indy and some other things, but you need to be sure it does not use Forms, windows, Libc, or and Q units.

if you get segmentation errors (linux), its because either you have used one of the gui parts, or your missing a .so somwhere
Reply With Quote
Reply

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


All times are GMT. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.