INFO: ????? ??????? 4.0 ???? Jet OLE DB SELECT @@ ??????

?????? ????????? ?????? ?????????
???? ???????: 232144 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

???? ???? Jet OLE DB ??????? 4.0 ????????? SELECT @@ ?????? ???? ???? ?? ??????? ??????? ???? ????? ????? ???????? ???? ?? ??????? ??? ???????. ?? ???? ????? ?????? ??????? ????????? ??? ????????? ?????? ??? ????? ???????? ??? ????? ??? ????????? ??????. ???? ??? ?????? ?? ????? ?????? Jet 4.0 ???? ??? ?? ????????? ??????.

??????? ????

???? ???????? ???????? ??????? ???????? ???? @@ SELECT ???????? ???? ??? ????? ??????? ???? ??????. ??? ????? ????????? ???????? ???????? ????????? ???????? ?????? ???? ?????????.
Dim cnDatabase As ADODB.Connection
Dim rsNewAutoIncrement As ADODB.Recordset
Dim strConn As String
Dim strSQL As String
Dim strPathToMDB As String
   
strPathToMDB = "C:\NewJet4.MDB"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=" & strPathToMDB & ";"
Set cnDatabase = New ADODB.Connection
    cnDatabase.Open strConn
    
    strSQL = "CREATE TABLE AutoIncrementTest " & _
             "(ID int identity, Description varchar(40), " & _
             "CONSTRAINT AutoIncrementTest_PrimaryKey PRIMARY KEY (ID))"
    cnDatabase.Execute strSQL, , adCmdText + adExecuteNoRecords
    
    strSQL = "INSERT INTO AutoIncrementTest " & _
             "(Description) VALUES ('AutoIncrement Test')"
    cnDatabase.Execute strSQL, , adCmdText + adExecuteNoRecords
    
    strSQL = "SELECT @@Identity"
    Set rsNewAutoIncrement = New ADODB.Recordset
    rsNewAutoIncrement.Open strSQL, cnDatabase, adOpenForwardOnly, _
                            adLockReadOnly, adCmdText
    MsgBox "New Auto-increment value is: " & rsNewAutoIncrement(0).Value

    rsNewAutoIncrement.Close
    Set rsNewAutoIncrement = Nothing
    strSQL = "DROP TABLE AutoIncrementTest"
    cnDatabase.Execute strSQL, , adCmdText + adExecuteNoRecords
    cnDatabase.Close
Set cnDatabase = Nothing
				
???? ??? ??? ??????? ??????? ?????? ?????? ???? ??? ????? ??????? ??????? ?????? ?? ??????? ??????? ?????? ?????? ActiveX (ADO) ?????? ?? ADO 2.1 ?????????? ??????. ??? ????? ?? ???? ??? ???? Jet ?? ???? ??????? Update ?? UpdateBatch (???????? ??? ??????? LockType) ?????? ????? ?????? ADO ??????? INSERT INTO ?????? ?? ???? ?? ??????. ??? ???? ????? ?????? ??????? ??? ??? ????? ??????? ? ????? ADO ????? ?????? ??????? SELECT @@ ???? ???????? ?????? ???? ?? ??????? ???? ????? ????? ???????. ???? ???????? ???????? ??????? ??? ??????:
Dim cnDatabase As ADODB.Connection
Dim rsNewAutoIncrement As ADODB.Recordset
Dim strConn As String
Dim strSQL As String
Dim strPathToMDB As String
    
strPathToMDB = "C:\NewJet4.MDB"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source=" & strPathToMDB & ";"
    Set cnDatabase = New ADODB.Connection
    cnDatabase.Open strConn
    
    strSQL = "CREATE TABLE AutoIncrementTest " & _
             "(ID int identity, Description varchar(40), " & _
             "CONSTRAINT AutoIncrementTest_PrimaryKey PRIMARY KEY (ID))"
    cnDatabase.Execute strSQL, , adCmdText + adExecuteNoRecords

    strSQL = "SELECT ID, Description FROM AutoIncrementTest"
    Set rsNewAutoIncrement = New ADODB.Recordset
    rsNewAutoIncrement.CursorLocation = adUseClient
    rsNewAutoIncrement.Open strSQL, cnDatabase, adOpenStatic, _
                            adLockOptimistic, adCmdText
    rsNewAutoIncrement.AddNew
    rsNewAutoIncrement("Description").Value = "AutoIncrement Test"
    rsNewAutoIncrement.Update
    MsgBox "New Auto-increment value is: " & rsNewAutoIncrement(0).Value

    rsNewAutoIncrement.Close
    Set rsNewAutoIncrement = Nothing
    strSQL = "DROP TABLE AutoIncrementTest"
    cnDatabase.Execute strSQL, , adCmdText + adExecuteNoRecords
    cnDatabase.Close
Set cnDatabase = Nothing
				
????? ????? ????? ?????? Jet 4.0 ?????? ????? ???????? Microsoft Access 2000 ?? ???????? ????? ADOX ??????? MDAC 2.1. ???????? ??? ??????? ?? ????? Visual Basic ????? ???? ??? Microsoft ADO Ext. 2.1 ?? DDL ???????. ????? ??????? ????????? ???????? ??? ??? ?? ????? ????? ?????? Jet 4.0 ?????:
Dim strPathToMDB As String
Dim catNewDatabase As ADOX.Catalog
    
    strPathToMDB = "C:\NewJet4.MDB"
    If Dir(strPathToMDB) <> "" Then
        Kill strPathToMDB
    End If
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
              "Data Source=" & strPathToMDB & ";"
    Set catNewDatabase = New ADOX.Catalog
    catNewDatabase.Create strConn
    Set catNewDatabase = Nothing
				
?????? ????? ????? ?????? Microsoft Access ???? ?? ????? "????? OLEDB:Engine Jet" ??????? ?? ?????? ????? ???? ?????. ????? ??????? ?????? ???? 5 ?????? 4.x Jet. ???? ????????? ???????? ???????? ???????? ???????:
Dim cnDatabase As ADODB.Connection
Dim strConn As String
Dim strPathToMDB As String
    
strPathToMDB = "C:\NewJet4.MDB"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source=" & strPathToMDB & ";"
Set cnDatabase = New ADODB.Connection
    cnDatabase.Open strConn
    If cnDatabase.Properties("Jet OLEDB:Engine Type").Value = 5 Then
        MsgBox "Jet 4.0 database"
    Else
        MsgBox "Not a Jet 4.0 database"
    End If
    cnDatabase.Close
Set cnDatabase = Nothing
				

?????

Microsoft ?????? Access SDK; ????? ???: "Provider-Defined ?????"; ???????: "DBPROPSET_JETOLEDB_DBINIT"

???????

???? ???????: 232144 - ????? ??? ??????: 09/????/1424 - ??????: 3.1
????? ???
  • Microsoft OLE DB Provider for Jet 4.0
  • Microsoft Data Access Components 2.1 Service Pack 2
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.6
  • Microsoft Data Access Components 2.7
  • Microsoft ActiveX Data Objects 2.1 Service Pack 2
  • Microsoft ActiveX Data Objects 2.5
  • Microsoft ActiveX Data Objects 2.6
  • Microsoft ActiveX Data Objects 2.7
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
????? ??????: 
kbmt kbdatabase kbinfo kbjet KB232144 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????232144

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com