Problem with ADO 1.5 and Access 8.0 
Author Message
 Problem with ADO 1.5 and Access 8.0

Hi all!!!
I try to use ADO to create a new table in the mdb.database
Sometimes it works fine and im able to create a new table.
Sometimes it failes badly without changing a single char in the source code
Can anyone tell me whats wrong in the code below:
'<<<In the common module
----------------------------------
Global daoDB As Database
Global adoConn As ADODB.Connection
Global adoComm As ADODB.Command
Global adoRecord As ADODB.Recordset
Private Sub Form_Load()
    On Error GoTo ErrHand:
    '<<<Initializing the ADO-objects>>>>
    '----------------------------------------------
    Set adoConn = CreateObject("ADODB.Connection")
    adoConn.ConnectionString = "DBQ=NETVOC32.MDB;" & _
                  "DRIVER={Microsoft Access Driver (*.mdb)};" & _
                  "DefaultDir=d:\TEMP;" & _
                  "UID=admin;PWD=;"
    Set adoComm = CreateObject("ADODB.Command")
    Set adoRecord = CreateObject("ADODB.Recordset")
    '<<<<Creating new database "d:\temp\Netvoc32.mdb">>>>
    (havent figure out yet how to do thin using ADO)
    ------------------------------------------------------------------------
---
    Set daoDB = Workspaces(0).CreateDatabase("d:\temp\NetVoc32.mdb",
dbLangGeneral)
    daoDB.Close
    Exit Sub
ErrHand:
    MsgBox "#" & Err.Number & Chr(13) & Err.Description, vbCritical, "ERROR
!!!"
    Exit Sub
Private Sub cmdMake_Click()
Dim strCommand As String, Table As String
Dim adoError As ADODB.Error, ErrMsg As String
    On Error GoTo Err_Execute:
    adoConn.Open
    For m = 48 To 57
        Table = Trim(Chr(m))
        strCommand = "Create table [" & Table & "] ([ID] NUMBER,
[ABBREVIATION] TEXT," & _
                    "[EXP] TEXT, [EXT] MEMO)"
        adoConn.Execute strComm, , adCmdText
        Next
    Exit Sub
Err_Execute:
    ' Notify of any errors that result from
    ' executing the query.
    If adoConn.Errors.Count > 0 Then
        For Each adoError In adoConn.Errors
            s$ = adoErr(adoError.Number)      '(This is my own function for
dealing with OLE-DB-errors)
            ErrMsg = ErrMsg & Chr(13) & Chr(13) & "Number: " &
adoError.Number & Chr(13) & _
                    "Description: " & adoError.Description & Chr(13) & _
                    "SQL-State: " & adoError.SQLState & Chr(13) & _
                    "Native code: " & adoError.NativeError & Chr(13) & _
                    "Source: " & adoError.Source & Chr(13) & _
                    "OLE-description: " & s$
        Next
        MsgBox ErrMsg, vbCritical, "ERROR !!!"
    End If
    On Error GoTo 0
    adoConn.Close
    Exit Sub
End Sub
Like i said before sometimes it creates successfully new table named '0'
Sometimes it generates an error described below:

Number: -2147217904
Description: [Microsoft][ODBC Microsoft Access 97 D
SQL-State: 07001
Native code: 5
Source: Microsoft OLE DB Provider for ODBC Drivers
OLE-error description: No value given for one or more required parameters.

--
Thanx and bye !!!
My email-addresses:



Finland



Sat, 13 May 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. VB5EE setup wizard and mdac 1.5 (ado 1.5) problem

2. Problem writing to Access 97 DB with ADO 1.5 and 2.1 (using ODBC)

3. Please HELP! ADO 1.0 to 1.5 problem

4. VB5, ADO 1.5, SQL Server 6.5 problem

5. ODBC ver. 3.7 and ADO 1.5 problem

6. VB5, ADO 1.5, SQL Server 6.5 problem

7. Please HELP! ADO 1.0 to 1.5 problem

8. LDAP connection with ADO 1.5

9. ADO 1.5 CMD error when executing Stored Procedures??

10. ADO 1.5, Where do u get it ?

11. LDAP connection with ADO 1.5

12. Distributing ADO 1.5

 

 
Powered by phpBB® Forum Software