在访问中调用数据库的正确格式是什么,带有空格的'文件夹'?

时间:2015-05-26 11:48:23

标签: vb.net ms-access-2013

float allowD = 0.95f;
        AbstractStringMetric metric = new JaroWinkler();
if (metric.getSimilarity(choice.toLowerCase(), fromTextRecognizer.trim().toLowerCase()) > allowD) {
// match found
}

我将这行代码放在一个模块下,所以我不必每次都调用它。这是上面代码连接到的代码......

Public connstring As String = "Provider = Microsoft.ACE.Oledb.12.0; Data Source = C:\Users\blablabla\Document\Visual Studio 2013\Project\rentalsystem\rental_db.accdb"

现在当它所附加的表单/窗口加载时,表单/窗口不会打开。然后它突出显示

Public Sub loadLVusers()
    LVusers.Items.Clear()
    Dim sqlcode As String = "select id_code, user_lastname, user_firstname, user_midname, user_username, user_password, user_email, user_privilege from tblUsers"
    Dim sqlcomd As New OleDb.OleDbCommand(sqlcode)
    sqlcomd.Connection = New OleDb.OleDbConnection(connstring)
    sqlcomd.Connection.Open()
    Dim DA As New OleDb.OleDbDataAdapter(sqlcomd)
    Dim DS As New DataSet
    DA.Fill(DS, "Pi")
    If DS.Tables("Pi").Rows.Count > 0 Then
        Dim Ic(100) As String
        For r = 0 To DS.Tables("Pi").Rows.Count - 1
            For c = 0 To DS.Tables("Pi").Columns.Count - 1
                Ic(c) = DS.Tables("Pi").Rows(r)(c).ToString
            Next
            Dim LVI As New ListViewItem(Ic)
            LVusers.Items.Add(LVI)
        Next
    End If
End Sub

所以我猜这与文件路径格式有关

0 个答案:

没有答案