delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

Must i use the ODBC connecter then as wel?
Otherwise i must leave everything as it is and try to create and modify odbc registry entries on the fly! Any ideas please?


Ok i've given up on trying to change my server in the DATASOURCES through delphi.So what i want to try then is connecting differently to the database. I like to know how other people connect to the mysql database. Should i change my whole project? I am using the BDE components through out the project.Must i use the ODBC connecter then as wel?
Otherwise i must leave everything as it is and try to create and modify odbc registry entries on the fly! Any ideas please?

TOP


Originally Posted by icuras
Ok i've given up on trying to change my server in the DATASOURCES through delphi.So what i want to try then is connecting differently to the database. I like to know how other people connect to the mysql database. Should i change my whole project? I am using the BDE components through out the project.Must i use the ODBC connecter then as wel?
Otherwise i must leave everything as it is and try to create and modify odbc registry entries on the fly! Any ideas please?
Have a look at this
http://www.productivity.org/projects/tmysql/
http://delphi.about.com/od/mysql/MySQL_with_Delphi.htm
http://www.devarticles.com/c/a/Delphi-Kylix/Using-Delphi-with-MySQL/
The first one is a set of components, the other two are ODBC tutorials. Far more comprehensive than an answer here
Bob Pointon

TOP

Thanks very much.i think ill stick with my odbc then.much easier.
I have a nother question. Lets say i have a server with mysql on.i use a laptop to connect to it in the office.So it is local.Easy i set the ODBC up with "localhost". Now i go home. I want to connect to my database.I am not local anymore.But i have a fixed IP so that i can connect to my server. Is there a way through delphi to connect to that server while i am at home WITHOUT changing the odbc SERVER = to my fix ip?
Thanks in advanced!!

TOP


Originally Posted by icuras
Thanks very much.i think ill stick with my odbc then.much easier.
I have a nother question. Lets say i have a server with mysql on.i use a laptop to connect to it in the office.So it is local.Easy i set the ODBC up with "localhost". Now i go home. I want to connect to my database.I am not local anymore.But i have a fixed IP so that i can connect to my server. Is there a way through delphi to connect to that server while i am at home WITHOUT changing the odbc SERVER = to my fix ip?
Thanks in advanced!!
im no delphi expert....(never used it before tonight)...but could u not add some conditional logic to check for the server's existance on your localhost.
kinda like (pseudo code ftw)
IF able to estabish connection to mysql on localhost
THEN connect
ELSE connect via fixed ip remotely
im sure there are much more elegant approach's to this, but u get the gist of it
(im a coldfusion programmer new to delphi...so i dont have a full understanding of its capabilities yet)

TOP

abstract:

Must i use the ODBC connecter then as wel?
Otherwise i must leave everything as it is and try to create and modify odbc registry entries on the fly! Any ideas please?


Thanks newbie for the reply...i tried the exact code that you use there.
i tried changing the server as you said to localhost or the ip but you cannot do that i suppose.which seems logical cause when you set it up in teh ODBC its written to the registry.And i am not changing the registry i am jsut telling him where to go and look.
It will be nice if i can write the registry item away everytime i start up but hey that it to advanced for me.i dont think anybody knows how to do that.
So for now i am just changing my ip everytime..which is a big pain!!But i would like a solution for it though

TOP

Back Forum