I have written a remote backup utility for one of the software packages that we are supporting. The utility has succesfully been installed at 38 sites and is working like a champ. I have run into an issue where I am not able to connect to the database while inside a terminal services session, this works perfectly when on the console either locally or through vnc but not over terminal services. The problem just seems to occur while connecting through terminal services I can set the program to run as a scheduled task on the machine and it runs perfect along with running in a real console session. I am really just not sure who's problem this is... odbc is returning "database server not found". I am crossposting to the .net forum.

Thank you,
Norman Laskie

Here are the configurations used at some of our sites:
Sybase Adaptive Server Anywhere 9.0.1.1844
Microsoft Dotnet Framework 1.0 or 1.1 (tested on both)
Windows XP, 2000, and Server 2003
ODBC.NET
Sybase Odbc driver


_______________________________________________


Here is a copy of my connectToDatabase function:
Private Function connectToDatabase() As Boolean
Try
If (databaseTextBox.Text.Equals("") <> True) Then

If (connection.State = ConnectionState.Closed) Then
connection.ConnectionString = "Driver=" + driversComboBox.SelectedItem + _
"; DefaultDir=" + Path.GetDirectoryName(databaseTextBox.Text) + _
";Dbf=" + databaseTextBox.Text + ";DBN=database;Uid=" + usernameTextBox.Text + _
";Pwd=" + passwordTextBox.Text + ";Dsn="""""

connection.Open()

If (connection.State = ConnectionState.Open) Then

databaseStatus.ForeColor = System.Drawing.Color.Green
databaseStatus.Text = "Connected"
StatusBar.Panels.Item(0).Text = "Connected to database"
databaseTestStatusLabel.Text = "Connection Successful"
databaseTestStatusLabel.ForeColor = System.Drawing.Color.Green
Else
databaseTestStatusLabel.ForeColor = System.Drawing.Color.Red
databaseTestStatusLabel.Text = "Connection Failed"
End If
Return True
End If
Return True
Else

Return False
End If

Catch odbcexception As OdbcException
databaseTestStatusLabel.ForeColor = System.Drawing.Color.Red
databaseTestStatusLabel.Text = "Connection Failed"
If runningBackupDatabaseEngine = False Then
resultsRichTextBox.Text += vbCrLf + " " + odbcexception.Errors.Item(0).ToString.Substring(od bcexception.Errors.Item(0).ToString.LastIndexOf("]") + 1) + vbCrLf
End If

Return False
End Try
End Function