本文介绍了无法连接到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发针对入库的移动扫描仪应用程序。用户只需扫描托盘编号和货架编号,系统将自动更新到我们的主数据库。问题是,我无法连接到我的数据库。我们有3个数据库。

我们在win server 2003(主数据库)上使用SQL2000,sql2008(帐户数据库)都在同一个网络上加上(1个分支数据库,SQL2000)通过V.P.N连接。我通过I.P地址连接。我的扫描仪可以连接到分支数据库和帐户数据库,但无法连接到主数据库。 未找到SQL Server或拒绝访问错误。我想念的是什么问题或任何设置。请参考我的编码..

我在ping服务器ip地址时收到回复。我不是网络方面的专家,而且还是VB.net的新手



提前感谢。



Hi, i am developing mobile scanner application for stock inbound. User only have to scan pallet number and racking number and the system will automatically update to our main database. The problem is, i can''t connect to my database. we have 3 Database.
we are using SQL2000 on win server 2003 ( main database), sql2008 ( Account Database) all on same network plus (1 branch database, SQL2000) connected through V.P.N. i connected through I.P Address. My scanner can connect to Branch database and Account Database but cant connect to Main database. "SQL Server not found or access denied" error. what is the problem or any setting that i miss. refer to my coding..
I receive a reply when ping to the server ip address. i''m not really expert in network and still new in VB.net

Thank in advance.

Imports System.Data
Imports System.Net
Imports System.Data.SqlServerCe
Imports System.Data.SqlClient

Private Sub btnConnect_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
        'X = GetLocalIP()
        If Not Connected_To_Network() Then
            MessageBox.Show("You are not connected to the network!", "No Connection")
            Exit Sub
        End If

        Select Case btnConnect.Text

            Case "OpenDB"
                Try
                    sqlConn = New SqlConnection ("Persist Security Info=False;Integrated Security=False;Server=194.100.1.248,1433;initial catalog=AinDataSQL;user id=sa;password=password;")
                    sqlConn.Open()
                    btnConnect.Text = "CloseDB"
                    lblConnect.Text = "Connected to Database"
                    'pnlFunctions.Visible = True
                Catch Ex As SqlClient.SqlException
                    DisplaySQLErrors(Ex, "Open")
                End Try
            Case "CloseDB"
                Try
                    sqlConn.Close()
                    btnConnect.Text = "OpenDB"
                    lblConnect.Text = "Database disconnected"

                Catch ex As Exception
                    DisplaySQLErrors(ex, "Open")
                End Try

        End Select
        Me.Refresh()
    End Sub

推荐答案


这篇关于无法连接到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 19:39