Results 1 to 10 of 10
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    As string to text (2000 sr-1)

    i have this routine and have dimensioned FOGLIO As string...
    Naturally in PROVADatabase.Execute "DELETE * FROM FOGLIO" the macro go in error because FOGLIO assuming value with " "...
    How to transform the value of var FOGLIO without " "

    Sub DELETE_RECORD(FOGLIO)

    Dim PROVADatabase As Object
    Set PROVADatabase = CreateObject("ADODB.Connection")
    PROVADatabase.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='" & gPROVADatabasePath & "'; User Id=admin; Password=;"
    PROVADatabase.Execute "DELETE * FROM FOGLIO"
    PROVADatabase.Close
    Set PROVADatabase = Nothing

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: As string to text (2000 sr-1)

    Does this do what you want?

    PROVADatabase.Execute "DELETE * FROM " & FOGLIO

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: As string to text (2000 sr-1)

    Naturally work fine!
    Tks.

    same prob with this line, i want to assign the value in RS.Open from the value assume FOGLIO instead "LUSTSTP":

    RS.Open "LUSTSTP", CN, adOpenKeyset, adLockOptimistic, adCmdTableDirect

    i have maked this but have error

    RS.Open FOGLIO, CN, adOpenKeyset, adLockOptimistic, adCmdTableDirect

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: As string to text (2000 sr-1)

    What is the error message?

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: As string to text (2000 sr-1)

    peraphs solved with:

    RS.Open "" & FOGLIO & "", CN, adOpenKeyset, adLockOptimistic, adCmdTableDirect

    is correct?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: As string to text (2000 sr-1)

    I wouldn't think so, but if it works for you, that's fine.

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: As string to text (2000 sr-1)

    yes work fine....

  8. #8
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: As string to text (2000 sr-1)

    Hans based this discussion how to modify this line:
    OggettoRecordset.Open "SELECT Count(PROVA1) As Cnt FROM INPS_02", StringaDiConnessione, adOpenKeyset, adLockOptimistic, adCmdText

    in effect intstead to use INPS_02 i use FOGLIO

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: As string to text (2000 sr-1)

    Try

    OggettoRecordset.Open "SELECT Count(PROVA1) As Cnt FROM " & FOGLIO, StringaDiConnessione, ...

    and if that doesn't work, try

    OggettoRecordset.Open "SELECT Count(PROVA1) As Cnt FROM [" & FOGLIO & "]", StringaDiConnessione, ...

  10. #10
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: As string to text (2000 sr-1)

    Tks first line work fine!

Posting Permissions

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