Results 1 to 3 of 3

Thread: [RESOLVED] Database Delete

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Resolved [RESOLVED] Database Delete

    PHP Code:
     Sub Process_Data() 'Delete A Data Information
         Set_Title
         Set Connects = New ADODB.Connection
         Connects.Provider = "Microsoft.jet.oledb.4.0"
         Connects.Properties("Jet OLEDB:database Password").Value = Trim(Cfg.Data_Password)
         Connects.ConnectionString = "data source=" & AA(4)
         Connects.Open
         StrSql = ""
         StrSql = Table_Titles(12)
         StrSql = "DELETE FROM " & StrSql & " WHERE Account = '" & Acct & "'"
       '  
    Connects.Execute StrSql
         
    For 1 To 30
          StrSql 
    ""
          
    StrSql Table_Titles(13)
          
    StrSql "DELETE FROM " StrSql " WHERE Account = '" Acct "'"
          
    Connects.Execute StrSql
         Next
         Connects
    .Close
        End Sub 
    The AA(3) is the location and name of the Database.

    My problem is the Connects.Execute StrSql gives me and error database critor mismatch.
    I set for the fields using the Table_Titles and it works in one program but for the life of me I must have missed something.
    All references are set in the program that works and set the same in the one I am working on.
    Last edited by Dbee; Mar 29th, 2008 at 11:49 PM.
    Don
    (OLD DOS Programmer)

  2. #2
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: Database Delete

    Is the Account field numeric or text?
    Why are you doing this inside a loop?

    It's a good habit to wrap field and table names etc in brackets, eg
    StrSql = "DELETE FROM [" & StrSql & "] WHERE [Account] = '" & Acct & "'"
    because if the value of Table_Titles(13) has a space in it you will get an error.
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Re: Database Delete

    Found Problem The Field must be in Text I had mine set in Number
    Don
    (OLD DOS Programmer)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width