Pocket PC w/ SQL Server 2000 and 2005 (Full Version)

All Forums >> [.NET Compact Framework Development] >> .NET Compact Framework - VB.NET



Message


jp2buzz -> Pocket PC w/ SQL Server 2000 and 2005 (3/4/2008 10:06:12 AM)

Using Visual Studio 2005 Professional:

We have two versions of SQL Server running on one machine: SQL Server 2000 Enterprise (Sql2000) and SQL Server 2005 Express (Sql2005). Sql2000 does more work, and it is used internally in our organization. Sql2005 is only a "light duty" program, but we only use it for our company's website applications.

We need to connect the Pocket PC (PPC) to Sql2000. Our PCs can connect, but not the Pocket PCs.

The Pocket PCs can ping Sql2000, but when our software tries to open an Sql Connection, we get the following SqlException Error Message:
quote:

SQL Server does not exist or access denied.
Since we can ping, we know the server exists and can be seen from the PPC.

We have tried multiple versions of the connection string, but this does not seem to be the problem.

Our System Admin assures me that the server is not running a firewall, so what else would prevent the PPC from being able to connect to Sql2000?

The PPC does not have a login ID/PWD, so I say we should not be using Integrated Security.

Sql2000 uses port 1433, and it is setup to accept both SQL Server and Windows Authentication.

We have tried different User ID/Password combinations; some have Administrator access, while others only have access to the tables we need to read.

Here are the different connection strings we have tried:
Data Source=CPAPP;Initial Catalog=AIO;Integrated Security=True;User ID=public;Password=public;

Data Source=172.16.8.105,1433;Initial Catalog=AIO;Integrated Security=True;User ID=AIO\public;Password=public;

Data Source=172.16.8.105,1433;Initial Catalog=AIO;Integrated Security=True;User ID=AIO\vti;Password=vti;

Data Source=CPAPP;Initial Catalog=AIO;Integrated Security=False;User ID=aio\vti;Password=vti;

Data Source=CPAPP;Initial Catalog=AIO;Integrated Security=False;User ID=public;Password=public;

Data Source=CPAPP;Initial Catalog=AIO;User ID=test;Password=test;

Data Source=CPAPP;Initial Catalog=AIO;User ID=public;Password=public;

Data Source=CPAPP;Initial Catalog=AIO;Integrated Security=True;User ID=public;Password=public;
Does anybody have any information on this?

I have posted this question on Microsoft's Forum for Pocket PC Developers, but nobody there has any idea.




petevick -> RE: Pocket PC w/ SQL Server 2000 and 2005 (3/4/2008 11:13:51 AM)

Hi,
I wrote an article on this for devbuzz here which used Sql2000 at the time - does it help?





jp2buzz -> RE: Pocket PC w/ SQL Server 2000 and 2005 (3/4/2008 12:00:05 PM)

Hi Mr. Vickers.

I actually followed your code for connecting. :)

I used it to check that I am connected to a network, then used your SqlException technique to get the specifics of the error.

I created a very stripped down version of my code, and it stills throws the SqlException.

Here is the actual code, that will probably work great for most people:
Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Imports System.Net
Imports System.Net.Sockets
Imports System.Runtime.InteropServices
Public Class Class1
 Private strSql9th As String = "Persist Security Info=False;Integrated Security=False;" & _
                   "Server=CPAPP,1433;Initial Catalog=AIO;User ID=public;password=public;"
 Public sqlConn As New SqlConnection(strSql9th)
 Sub Main()
   Dim connected As Boolean = Connected_To_Network()
   If (connected = True) Then
     Try
       sqlConn.Open()
     Catch ex As SqlException
       ' SQL Exception Reader routine (START)
       Dim i As Integer
       Dim msgFmt As String = "Error {0}: {1}" + vbCrLf + vbCrLf + "Source: {2}" + vbCrLf + vbCrLf + "Call: {3}"
       Dim ttlFmt As String = "Error {0} of {1} - Level {2}"
       For i = 1 To ex.Errors.Count
         Dim msg As String
         Dim ttl As String
         With ex.Errors(i - 1)
           msg = String.Format(msgFmt, .LineNumber + 1, .Message, .Source, .Procedure)
           ttl = String.Format(ttlFmt, i, ex.Errors.Count, .Class)
         End With
         Dim dr As Windows.Forms.DialogResult = _
              MessageBox.Show(msg + vbCrLf + vbCrLf + "Exit Application?", ttl, _
              MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button1)
         If (dr = Windows.Forms.DialogResult.Yes) Then
           connected = False
           Application.Exit()
         End If
       Next i
       ' SQL Exception Reader routine (END)
     Finally
       sqlConn.Close()
     End Try
   End If
   If (connected = True) Then
     Dim PackageManager As New frmScanPackout
     PackageManager.ShowDialog()
   End If
 End Sub
 Public Function Connected_To_Network() As Boolean
   Dim ipAddress() As System.Net.IPAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList
   Dim localEndPoint As IPEndPoint = New IPEndPoint(ipAddress(0), 0)
   Try
     If localEndPoint.Address.ToString = "127.0.0.1" Then
       Return False
     Else
       Return True
     End If
   Catch ex As Exception
     Return False
   End Try
 End Function
End Class


What would cause Sql2000 to refuse the login?

Is PPC refusing to connect to Sql2000?

Is there a way to get more detailed information about this error whenever it happens? I've tried looking in the Sql2000 message log, but I haven't found anything there.




petevick -> RE: Pocket PC w/ SQL Server 2000 and 2005 (3/4/2008 3:41:36 PM)

Hi,
generally, when I have seen that error, it has been a firewall issue, blocking on the SQL port.

There again, it may be a confusion between Sql2000 and Sql2005 being on the same machine.

Will try and look into it further if I can

Pete





jp2buzz -> RE: Pocket PC w/ SQL Server 2000 and 2005 (3/4/2008 4:05:17 PM)

Our IT guy is in training, but he keeps saying there is no firewall installed.

Is there any way that I could run a firewall test?




gilkaths -> RE: Pocket PC w/ SQL Server 2000 and 2005 (3/5/2008 6:22:10 AM)

Hello,

I encountered this problem a year ago.  I just turned off my firewall because i'm using Windows XP. 




jp2buzz -> RE: Pocket PC w/ SQL Server 2000 and 2005 (3/5/2008 9:03:18 AM)

Our SQL Server is running on an Active Directory 2003 Server with the default domain policies set.

That's what our IT guy told me. What is Active Directory? Does it cause connection problems?

I'm going to start Googling that route, but if anybody has information on this, please let me know.




Page: [1]



Forum Software © ASPPlayground.NET Advanced Edition 2.5.5 Unicode

0.016