Client-server application (connection problem)

hello..

this is the first time i'm developing client-server application

now i'm testing the application with my server
the connection made with SQL Server using this

"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=dbDesa;Data Source=MSSYA"

i need to deploy the complete application to another server
so i assumed, the connection string above can't be used
how to solve this problem
[473 byte] By [shaf_sar] at [2007-11-19 1:53:36]
# 1 Re: Client-server application (connection problem)
You can build the connection string in your program eg store it in an INI file, or in the registry and retrieve it before openning the connection.

The other way to do it, would be have a static connection string pointing to either an ODBC driver, or a UDL file and then changing them on the object computer.

HTH
jp140768 at 2007-11-9 21:00:57 >
# 2 Re: Client-server application (connection problem)
i'm a beginner... don't know how to do that
is there any simple technique
or maybe you can give me the example file
shaf_sar at 2007-11-9 21:01:57 >
# 3 Re: Client-server application (connection problem)
dim serverName as string
open app.path & "\myapp.ini" for input as #1

input #1, serverName

close #1

you can then use the "SERVER" clause of a connection string and say
connectionstring = "......;server=" & serverName

thats a simple (though not completely ideal - what if it can't find the file?) way to do it. you then just need a file called "myapp.ini" in the same folder as your .exe that contains the server name (in double quotes). yeah, it's not a true ini file, but they're on their way out anyway (XML people :rolleyes: ), and this will work and can get you started on doing it a better way.
Zeb at 2007-11-9 21:02:50 >
# 4 Re: Client-server application (connection problem)
i'm receiving this error messages

login failed for user '(null)'. Reason: Not associated with trusted SQL server connection
shaf_sar at 2007-11-9 21:03:55 >
# 5 Re: Client-server application (connection problem)
Can you change your code, to display the contents of the connection string to a message box, or step through your program, and just before it attempts to open the connection, jump to the intermediate window and print it. You can then show us what it says.

Maybe also show us the code that you are using to get the connection string etc.

Thanks,
jp140768 at 2007-11-9 21:05:01 >