0

below is the code which I am using

Private Sub Form_Load()
    On Error Resume Next

    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Smart Invoice\Smartdata.mdb;Persist Security Info=False"
    Adodc1.RecordSource = "Select * From tableSerMast"

End Sub

I am getting below said error:

[ADODC]: no RecordSource specified. [ADO] :Command text was not set for the command object

4

1 に答える 1

0

VBAを想定しますが、VB6に変更するのはそれほど難しいことではありません。

 Private Sub Form_Load()
    ''Almost never a good idea
    ''On Error Resume Next
    ''Reference: Microsoft ActiveX Data Objects x.x Library
    Dim adodc1 As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
        & "Data Source=D:\Smart Invoice\Smartdata.mdb;" _
        & "Persist Security Info=False"
    Adodc1.Open

    rs.Open "Select * From tableSerMast", Adodc1
End Sub
于 2012-08-03T10:47:32.240 に答える