连接不上accesss数据库,该如何处理

连接不上accesss数据库
Imports System.data
Imports System.Data.SqlClient
Public Class 用户登录

  Dim sqlcon As New SqlConnection()
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  Dim conn As String = "data source=.;connect timeout=5;User ID=sa;Password='123';initial catalog=POS收银系统;"

  sqlcon.ConnectionString = conn

  sqlcon.Open()

  Dim sqlcom As New SqlCommand

  sqlcom.CommandText = "select * from 用户信息 where 用户名='" & TextBox1.Text & " ' and 用户密码='" & TextBox2.Text & " 'and 用户类型='" & ComboBox1.Text & " ' "

  sqlcom.Connection = sqlcon

  Dim myds As New DataSet

  Dim myadapter As New SqlDataAdapter

  myadapter.SelectCommand = sqlcom

  myadapter.Fill(myds, "a")
  If ComboBox1.Text = "" Then
  MsgBox("请选择用户类型!", MsgBoxStyle.Information, "超市管理系统")

  ElseIf myds.Tables("a").Rows.Count = 0 Then

  MsgBox("用户名或密码错误,请从新输入!", MsgBoxStyle.Information, "超市管理系统")
  Else
  pos系统主界面.Show()
  Me.Hide()
  MsgBox("你好!你已成功登录!", MsgBoxStyle.Information, "超市管理系统")

  End If

  sqlcon.Close()
  End Sub
  Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  Me.Close()
  End Sub
  Private Sub ComboBox1_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedValueChanged
  If ComboBox1.Text = "超级管理员" Then
  clearr()
  Button1.Enabled = True
  TextBox1.Enabled = True
  TextBox2.Enabled = True
  End If
  If ComboBox1.Text = "普通管理员" Then
  clearr()
  Button1.Enabled = True
  TextBox1.Enabled = True
  TextBox2.Enabled = True
  End If
  If ComboBox1.Text = "普通员工" Then
  clearr()
  Button1.Enabled = False
  TextBox1.Enabled = False
  TextBox2.Enabled = False
  pos系统主界面.Show()
  Me.Hide()
  MsgBox("欢迎进入!", MsgBoxStyle.Information, "超市管理系统")

  End If
  If ComboBox1.Text = "提货员" Then
  clearr()

  Button1.Enabled = True
  TextBox1.Enabled = True
  TextBox2.Enabled = True
  End If
  If ComboBox1.Text = "进货员" Then
  clearr()

  Button1.Enabled = True
  TextBox1.Enabled = True
  TextBox2.Enabled = True
  End If
  End Sub
  Sub clearr()
  TextBox1.Text = ""
  TextBox2.Text = ""
  End Sub

   
   
End Class









Dim conn As String = "data source=.;connect timeout=5;User ID=sa;Password='123';initial catalog=POS收银系统;"
access没设密码 连接还要密码吗?










------解决方案--------------------