Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update DBASE IV Through VB6 ADO2.5

Status
Not open for further replies.

onetomany

Programmer
May 15, 2000
55
US
I am trying to update a Dbase IV table with vb 6 using ado 2.5. I thought that everything was going ok no vb errors no ADO errors. However when I searched the Dbase table for the record that I had inserted it was not there. I have include my code. I am baffled at how the code can execute without error but there is no record in the dbase table. Has Anyone run into this before or know of a possible reason.
Code:
Option Explicit

Private Const AudConString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\XXXX04\XXXX\Audpro\AUDpro.mdb;"
Private Const m_strAUDconstring As String = "Driver={Microsoft dBASE Driver (*.dbf)};" & _
           "DriverID=277;" & _
           "Dbq=\\XXX\XXX\ACDV\Data\;" & _
           "Exclusive=No;"

Private ErrorFilePath As String
Private objAudProCon As New ADODB.Connection
Private objAudInfoRS As New ADODB.Recordset
Private objFACSAcctType As New ADODB.Recordset
Private g_HostSettleTime As Integer
Private STTYPE() As String
Private STTYPEeof As Integer
Private Directions() As String
Private mblnCancel As Boolean


Private Enum ReturnOption
    ReturnACCTTYPE = 1
    ReturnLOANTYPE = 2
End Enum

'Public Event AmountDone(ByVal Max As Integer, ByVal Min As Integer, ByVal Current As Integer, ByVal Status As String, ByRef Cancel As Boolean)

Public Sub UpdateAUDdBase()
    Dim objAUDdBaseCon As New ADODB.Connection
    Dim objAUDdBaseRS As New ADODB.Recordset
    Dim objAUDdBaseControl As New ADODB.Recordset
    objAudProCon.ConnectionString = AudConString
objAudProCon.Open
    Dim strSQL As String
    Dim objField As ADODB.Field
    Dim dblMaxControlNum As Double

    
    
       strSQL = "SELECT  programAUDinfo.*, DivisionInfo.DivisionNum, DivisionInfo.COMPADDR, DivisionInfo.COMPCITY, DivisionInfo.COMPSTATE, " & _
    "DivisionInfo.COMPZIP, DivisionInfo.DivisionName, DivisionInfo.COMPAUTH, DivisionInfo.COMPPHONE, " & _
    "(DivisionInfo.EQUIFAXNUM) AS divEQUIFAXNUM, (DivisionInfo.TRWNUM) AS divTRWNUM, " & _
    "(DivisionInfo.TUNUM) AS divTUNUM, DivisionInfo.DivisionSessID, FACS_Acct_Type.* " & _
    "FROM (DivisionInfo INNER JOIN programAUDinfo ON DivisionInfo.DivisionId = programAUDinfo.DivisionId) INNER JOIN FACS_Acct_Type ON programAUDinfo.ID = FACS_Acct_Type.ID " & _
    ";"
    
       
    objAUDdBaseCon.Open m_strAUDconstring
    objAUDdBaseControl.Open "Select top 1 ControlNum as MaxControl from Control.dbf", objAUDdBaseCon ', adOpenForwardOnly, adLockOptimistic
    If Not objAUDdBaseControl.EOF Then
        dblMaxControlNum = CDbl(objAUDdBaseControl!MaxControl)
    Else
        MsgBox "Could not find max control number on the AUD dBase"
    End If

    objAudInfoRS.Open strSQL, objAudProCon, adOpenForwardOnly, adLockOptimistic
    Do Until objAudInfoRS.EOF
        Debug.Print Format(dblMaxControlNum + 1, "0000000000") & " starting to make sql string"
        strSQL = ""
        dblMaxControlNum = dblMaxControlNum + 1
        strSQL = "Insert Into Consumer("
        strSQL = strSQL & "COMPNAME"
        strSQL = strSQL & ", COMPADDR"
        strSQL = strSQL & ", COMPCITY"
        strSQL = strSQL & ", COMPSTATE"
        strSQL = strSQL & ", COMPZIP"
        strSQL = strSQL & ", COMPAUTH"
        strSQL = strSQL & ", COMPPHONE"
        strSQL = strSQL & ", CHANGECODE"
        strSQL = strSQL & ", CODE1"
        strSQL = strSQL & ", CODE2"
        strSQL = strSQL & ", CODE3"
        strSQL = strSQL & ", CODE4"
        strSQL = strSQL & ", NARR"
        strSQL = strSQL & ", ASSIND"
        strSQL = strSQL & ", LNAME"
        strSQL = strSQL & ", FNAME"
        strSQL = strSQL & ", MNAME"
        strSQL = strSQL & ", SUFFIX"
        strSQL = strSQL & ", LAKA"
        strSQL = strSQL & ", FAKA"
        strSQL = strSQL & ", MAKA"
        strSQL = strSQL & ", AKASUFFIX"
        strSQL = strSQL & ", ADDRESS"
        strSQL = strSQL & ", HOUSE"
        strSQL = strSQL & ", STREET"
        strSQL = strSQL & ", STTYPE"
        strSQL = strSQL & ", STDIR"
        strSQL = strSQL & ", UNIT"
        strSQL = strSQL & ", CITY"
        strSQL = strSQL & ", STATE"
        strSQL = strSQL & ", ZIP1"
        strSQL = strSQL & ", ZIP2"
        strSQL = strSQL & ", PREVADDR"
        strSQL = strSQL & ", PHOUSE"
        strSQL = strSQL & ", PSTREET"
        strSQL = strSQL & ", PSTTYPE"
        strSQL = strSQL & ", PSTDIR"
        strSQL = strSQL & ", PUNIT"
        strSQL = strSQL & ", PREVCITY"
        strSQL = strSQL & ", PREVSTATE"
        strSQL = strSQL & ", PREVZIP1"
        strSQL = strSQL & ", PREVZIP2"
        strSQL = strSQL & ", RESCODE"
        strSQL = strSQL & ", SSN"
        strSQL = strSQL & ", EQUIFAXNUM"
        strSQL = strSQL & ", TRWNUM"
        strSQL = strSQL & ", TUNUM"
        strSQL = strSQL & ", CCANUM"
        strSQL = strSQL & ", ACCTNUM"
        strSQL = strSQL & ", ACCTTYPE"
        strSQL = strSQL & ", ACCTSTAT"
        strSQL = strSQL & ", MOP"
        strSQL = strSQL & ", ACCTCOND"
        strSQL = strSQL & ", TERMS"
        strSQL = strSQL & ", DATEOPENED"
        strSQL = strSQL & ", STATDATE"
        strSQL = strSQL & ", REPDATE"
        strSQL = strSQL & ", OCCURDATE"
        strSQL = strSQL & ", DATECLOSED"
        strSQL = strSQL & ", HIGHCREDIT"
        strSQL = strSQL & ", CREDLIMIT"
        strSQL = strSQL & ", BALANCE"
        strSQL = strSQL & ", PASTDUE"
        strSQL = strSQL & ", MONTHPMT"
        strSQL = strSQL & ", COMMENT"
        strSQL = strSQL & ", ECOA"
        strSQL = strSQL & ", LOANTYPE"
        strSQL = strSQL & ", DELAMT1"
        strSQL = strSQL & ", DELDATE1"
        strSQL = strSQL & ", DELMOP1"
        strSQL = strSQL & ", DELDATE2"
        strSQL = strSQL & ", DELMOP2"
        strSQL = strSQL & ", DELDATE3"
        strSQL = strSQL & ", DELMOP3"
        strSQL = strSQL & ", MOSTRECDEL"
        strSQL = strSQL & ", SECRECDEL"
        strSQL = strSQL & ", CHARGEOFF"
        strSQL = strSQL & ", OTHERAMT"
        strSQL = strSQL & ", PMTSPAST"
        strSQL = strSQL & ", HISTMOS"
        strSQL = strSQL & ", PAST30"
        strSQL = strSQL & ", PAST60"
        strSQL = strSQL & ", PAST90"
        strSQL = strSQL & ", SERIOUS"
        strSQL = strSQL & ", CURRHIST"
        strSQL = strSQL & ", PMTHIST1"
        strSQL = strSQL & ", PMTHIST2"
        strSQL = strSQL & ", DESCTYPE"
        strSQL = strSQL & ", [DESC]"
        strSQL = strSQL & ", PHONE"
        strSQL = strSQL & ", DOB"
        strSQL = strSQL & ", AGE"
        strSQL = strSQL & ", EMP"
        strSQL = strSQL & ", OCC"
        strSQL = strSQL & ", SPOUSEEMP"
        strSQL = strSQL & ", SPOUSEOCC"
        strSQL = strSQL & ", ASSCODE"
        strSQL = strSQL & ", SPLNAME"
        strSQL = strSQL & ", SPFNAME"
        strSQL = strSQL & ", SPMNAME"
        strSQL = strSQL & ", SPSUFFIX"
        strSQL = strSQL & ", ADDRIND"
        strSQL = strSQL & ", SPADDRESS"
        strSQL = strSQL & ", SPHOUSE"
        strSQL = strSQL & ", SPSTREET"
        strSQL = strSQL & ", SPSTTYPE"
        strSQL = strSQL & ", SPSTDIR"
        strSQL = strSQL & ", SPUNIT"
        strSQL = strSQL & ", SPCITY"
        strSQL = strSQL & ", SPSTATE"
        strSQL = strSQL & ", SPZIP1"
        strSQL = strSQL & ", SPZIP2"
        strSQL = strSQL & ", SPSSN"
        strSQL = strSQL & ", CONTROLNUM"
        strSQL = strSQL & ", STATUS"
        strSQL = strSQL & ", STATUSCODE"
        strSQL = strSQL & ", SENDTHIS"
        strSQL = strSQL & ", OKTOSEND"
        strSQL = strSQL & ", SENT"
        strSQL = strSQL & ", DATESAVED"
        strSQL = strSQL & ", TIMESAVED"
        strSQL = strSQL & ", DATESENT"
        strSQL = strSQL & ", USERNAME"
        strSQL = strSQL & ", WANTVERIFY"
        strSQL = strSQL & ", GOTEFX"
        strSQL = strSQL & ", GOTTU"
        strSQL = strSQL & ", GOTTRW"
        strSQL = strSQL & ", GOTCCA"
        strSQL = strSQL & ", GOTVERIFY"
        strSQL = strSQL & ", DATEVERIFY"
        strSQL = strSQL & ", VERIFYCTL"
        strSQL = strSQL & ", DATEPRINT"
        strSQL = strSQL & ", COMPANYNUM"
        strSQL = strSQL & ", GRANTOR"
        strSQL = strSQL & ", USERMEMO"
        strSQL = strSQL & ", RESERVED1"
        strSQL = strSQL & ", RESERVED2"
        strSQL = strSQL & ", RESERVED3"
        strSQL = strSQL & ", RESERVED4"
        strSQL = strSQL & ", RESERVED5"
        strSQL = strSQL & ", USER1"
        strSQL = strSQL & ", USER2"
        strSQL = strSQL & ", USER3"
        strSQL = strSQL & ", EXTRA1"
        strSQL = strSQL & ", EXTRA2"
        strSQL = strSQL & ", EXTRA3"
        strSQL = strSQL & ", EXTRA4"
        strSQL = strSQL & ", EXTRA5"
        strSQL = strSQL & ", EXTRA6"
        strSQL = strSQL & ", EXTRA7"
        strSQL = strSQL & ", EXTRA8"
        strSQL = strSQL & ", EXTRA9"
        strSQL = strSQL & ", EXTRA10"
        strSQL = strSQL & ", EXTRA11"
        strSQL = strSQL & ", EXTRA12"
        strSQL = strSQL & ", EXTRA13"
        strSQL = strSQL & ", EXTRA14"
        strSQL = strSQL & ", EXTRA15"
        strSQL = strSQL & ", EXTRA16"
        strSQL = strSQL & ", EXTRA17"
        strSQL = strSQL & ", EXTRA18"
        strSQL = strSQL & ", EXTRA19"
        strSQL = strSQL & ", EXTRA20"
        strSQL = strSQL & ", TAG) Values("

              strSQL = strSQL & SQLfix(objAudInfoRS!DivisionName)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!COMPADDR)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!COMPCITY)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!COMPSTATE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!COMPZIP)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!COMPAUTH)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!COMPPHONE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CHANGECODE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CODE1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CODE2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CODE3)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CODE4)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!NARR)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!ASSIND)
        strSQL = strSQL & "," & "'Test'" 'SQLfix(objAudInfoRS!LNAME)
        strSQL = strSQL & "," & "'Test'" 'SQLfix(objAudInfoRS!FNAME)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!MNAME)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SUFFIX)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!LAKA)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!FAKA)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!MAKA)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!AKASUFFIX)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!Address)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!HOUSE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!STREET)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!STTYPE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!STDIR)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!UNIT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CITY)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!State)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!ZIP1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!ZIP2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PREVADDR)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PHOUSE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PSTREET)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PSTTYPE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PSTDIR)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PUNIT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PREVCITY)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PREVSTATE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PREVZIP1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PREVZIP2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!RESCODE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SSN)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EQUIFAXNUM)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!TRWNUM)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!TUNUM)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CCANUM)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!AcctNum)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!AcctType)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!ACCTSTAT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!MOP)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!ACCTCOND)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!TERMS)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DATEOPENED)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!STATDATE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!REPDATE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!OCCURDATE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DATECLOSED)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!HIGHCREDIT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CREDLIMIT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!BALANCE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PASTDUE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!MONTHPMT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!COMMENT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!ECOA)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!LOANTYPE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DELAMT1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DELDATE1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DELMOP1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DELDATE2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DELMOP2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DELDATE3)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DELMOP3)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!MOSTRECDEL)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SECRECDEL)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CHARGEOFF)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!OTHERAMT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PMTSPAST)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!HISTMOS)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PAST30)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PAST60)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PAST90)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SERIOUS)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!CURRHIST)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PMTHIST1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PMTHIST2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DESCTYPE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!Desc)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!PHONE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DOB)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!AGE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EMP)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!OCC)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPOUSEEMP)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPOUSEOCC)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!ASSCODE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPLNAME)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPFNAME)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPMNAME)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPSUFFIX)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!ADDRIND)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPADDRESS)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPHOUSE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPSTREET)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPSTTYPE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPSTDIR)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPUNIT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPCITY)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPSTATE)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPZIP1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPZIP2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SPSSN)
        strSQL = strSQL & "," & SQLfix(Format(dblMaxControlNum, "0000000000"))
        strSQL = strSQL & "," & SQLfix("ENTERING DATA")
        strSQL = strSQL & "," & SQLfix("3")
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SENDTHIS)
        strSQL = strSQL & "," & "'N'" 'SQLfix(objAudInfoRS!OKTOSEND)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!SENT)
        strSQL = strSQL & "," & SQLfix(Format(Now, "MMDDYY")) 'DateSaved
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!TIMESAVED) 'TimeSaved
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DATESENT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!USERNAME)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!WANTVERIFY)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!GOTEFX)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!GOTTU)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!GOTTRW)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!GOTCCA)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!GOTVERIFY)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DATEVERIFY)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!VERIFYCTL)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!DATEPRINT)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!COMPANYNUM)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!GRANTOR)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!USERMEMO)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!RESERVED1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!RESERVED2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!RESERVED3)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!RESERVED4)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!RESERVED5)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!USER1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!USER2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!USER3)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA1)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA2)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA3)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA4)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA5)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA6)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA7)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA8)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA9)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA10)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA11)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA12)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA13)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA14)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA15)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA16)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA17)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA18)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA19)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!EXTRA20)
        strSQL = strSQL & "," & SQLfix(objAudInfoRS!Tag) & ")"
        Debug.Print Format(dblMaxControlNum, "0000000000") & " sql string made"
        Debug.Print strSQL
        objAUDdBaseCon.Execute strSQL
        objAUDdBaseControl!controlnum = objAUDdBaseControl!controlnum + 1
        If objAUDdBaseCon.Errors.Count > 0 Then
        Dim i As Integer
        For i = 0 To objAUDdBaseCon.Errors.Count
        Debug.Print objAUDdBaseCon.Errors.Item(i).Description & objAUDdBaseCon.Errors.Item(i).Number & objAUDdBaseCon.Errors.Item(i).Source & objAUDdBaseCon.Errors.Item(i).NativeError
        Next
        End If
        objAudInfoRS.MoveNext
    Loop
    objAUDdBaseControl.Close
    objAudInfoRS.Close
    objAUDdBaseCon.Close
    
End Sub


Private Function SQLfix(SQL) As String
If IsNull(SQL) Then
    SQLfix = "null"
Else
    SQLfix = "'" & Replace(Replace(SQL, "'", ""), ",", "") & "'"
End If
End Function

Private Sub Pause(Length As Integer)
    Const ValueOfASecond As Double = (1 / 86400)
    Dim p_dtStartTime As Date
    Dim p_dtEndTime As Date
    Debug.Print "Pause Started:" & Now()
    p_dtStartTime = Now()
    p_dtEndTime = p_dtStartTime + (Length * ValueOfASecond)
    Do Until p_dtEndTime <= Now
    DoEvents
    Loop
    Debug.Print &quot;Pause Ended:&quot; & Now()
End Sub
 
I don't see any indications of creating a new table for the data to be stored into. All I see are queries.

Where's the strSQL=&quot;create <table>&quot; or
objAUDdBaseRS.createdatabase=&quot;<table>&quot; stuff?

Did I miss that section? --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
The Table already exists.
I am very new to dbase and have not been able to find very many resources to learn from.
This code was actually working and adding the records however they were not visible until I reindexed the table. Do you need to create the table in order for the records to be visible?Is there a way to reindex the table through VB?
I am also now having problems updating the fields after. dBase will let me insert but not update or delete a record.
Could anyone post an example of updating a table through VB.

thanks,
 
You can use ADO 2.5 from VB6 to update a DBF, but the trick is getting the index file to update.

A couple of years ago I had the same kind of problem using CDXs. My work around was to shell out to a Clipper exe that performed a reindex after the VB program was finished populating the DBFs. Of course, the DBF had to be isolated during the process.

There are 3rd party libs that may solve this problem. I was under a deadline and didn't have the time to experiment with a new 3rd party solution. I'm an old Clipper head turned VB/SQL/ASP, so the Clipper work around suited me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top