Jakka,
You don't need a DSN (data source name) because you've wrapped up the server
address, driver and database details in your connect string.
What a DSN does allow you to do though, is to move this logic into system
settings so that all you need do is specify a DSN name, and the other
details here are not required (driver included). Another huge benefit is the
ability to test a DSN connection before you even use the connection in your
code.
To create a DSN for your connection, go to "Start->Control
Panel->Administrative Tools->Data Sources(ODBC)".
There's a System DSN tab there for DSN's that any user that logs on can
access.
Click Create New... the rest is quite self explanatory, but let me know if
you've any problems.
At the end of creating the connection there's a "Test" button somewhere that
open and closes the connection for you to decide whether it's valid
configuration.
In your code all you need to do is specify the name of your DSN, plus a uid
and pwd...
http://www.able-consulting.com/MDAC/...BC_DSN.htm#DSN
good luck.
"Dakkar" <da****@sylveria.gen-dot-tr.no-spam.invalid> wrote in message
news:42********@127.0.0.1...
I think its because i didnt make the dsn is a system dsn but i dont
know how can i do it can somebody help me?
here is my connection code
MyCmd = new OdbcCommand();
MyConn = new OdbcConnection("DRIVER={MySQL ODBC 3.51
Driver};" + "SERVER=139.179.149.238;" +
"DATABASE=account;" + "UID=root;" +
"PWD=root;" + "OPTION=3;");
MyConn.Open();
MyCmd.Connection = MyConn;
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com