Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    Feb 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Language specific macros (word 2003, word 2000)

    I am writing macros that access a database that has french canadian data... The data in the database looks correct, however when i do a select against the data, the recordset.fields.value(0) does not have the correct value. Do i need to set any language specific references in my code?

    Thanks in advance

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

    Re: Language specific macros (word 2003, word 2000)

    Welcome to Woody's Lounge!

    Visual Basic is (with a small number of exceptions) language independent. As far as I know the code to access a database using DAO or ADODB does not belong to the exceptions.

    Try using recordset.Fields(0).Value instead of recordset.fields.value(0). Fieds are counted starting at 0, so Fields(0) refers to the first field in the recordset.

  3. #3
    New Lounger
    Join Date
    Feb 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Language specific macros (word 2003, word 2000)

    Yes, i understand that and i added a watch to look at the value of the select and the value was not as it is in the database. The data in the database(french canadian) does not match the data returned in the select. :-(

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

    Re: Language specific macros (word 2003, word 2000)

    Could you post (the relevant part of) the code you are using?

  5. #5
    New Lounger
    Join Date
    Feb 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Language specific macros (word 2003, word 2000)

    Sure ... here u go... contract_clause is the table that has the french canadian data. However when i add watch to look at "rs_def_bkng_1.Fields(1).Value", the data looks garbled:-(

    Dim rs_def_bkng_1 As Recordset
    Set qry = db.CreateQueryDef("")
    With qry
    .SQL = "SELECT clause_name, txt FROM contract_clause " & _
    "WHERE clause_num = 114 AND sub_clause_num = 1 AND version = 1"
    Set rs_def_bkng_1 = .OpenRecordset()
    End With
    If UserForm1.definite_bkng_option1.Value = True Then
    docNew.Bookmarks("def_option").Range.Text = rs_def_bkng_1.Fields(1).Value
    End If
    rs_def_bkng_1.Close

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Language specific macros (word 2003, word 2000)

    What do you mean by "garbled"? Are the words in the wrong order, are you seeing odd characters in the strings, or what? Is the "garbled" appearance only in the watch window, or elsewhere as well?
    Charlotte

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

    Re: Language specific macros (word 2003, word 2000)

    I don;t know what goes wrong. Could you post a stripped down copy of the database? See <post#=401925>post 401925</post#> for instructions (assuming it is an Access database).

  8. #8
    New Lounger
    Join Date
    Feb 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Language specific macros (word 2003, word 2000)

    ok here is what is in the database "Aussit

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Language specific macros (word 2003, word 2000

    Although I can't guarantee the results, you might have better luck using the newer ADO methods than using the older DAO functions when accessing this kind of data.

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Language specific macros (word 2003, word 2000)

    So the "garble" is in the accented characters? If you do a query, which do you see? The watch window generally doesn't know much about language settings, so if that's the only place you see oddness, I wouldn't worry about it.
    Charlotte

  11. #11
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Language specific macros (word 2003, word 2000)

    It looks to me like the font used to display in the watch window does not have the accented characters.
    Legare Coleman

Posting Permissions

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