Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Cannot insert weird characters to Access table

  • 03-12-2009 11:46pm
    #1
    Registered Users, Registered Users 2 Posts: 4,113 ✭✭✭


    I have an Access table with a field that I have to insert a lot of non-alphanumeric characters to. Example:
    (max([PLC00000015;VAR00001|Result;Result;*;enteredvalue],[PLC00000166;VAR00001|Result;Result])-min([PLC00000015;VAR00001|Result;Result;*;enteredvalue],[PLC00000166;VAR00001|Result;Result]))/mean([PLC00000015;VAR00001|Result;Result;*;enteredvalue],[PLC00000166;VAR00001|Result;Result])

    I have tried the memo field and the text field. Text doesn't work as it is more than 255 characters. Memo doesn't work either even though it should (the character restriction size with memo is 65535 characters I think).
    I think it has a problem with certain characters like "|" as some data that is not exactly like the example above goes into the table.
    It is with an embedded SQL statement in VBA I am attempting to insert it but even when I copy and paste the SQL into a query it doesn't go in either.
    That makes me think it is the table that is the problem.
    It is not an option for me to strip out characters that will not insert, everything has to go in.
    Any help will be greatly appreciated.


Comments

  • Closed Accounts Posts: 317 ✭✭tiptap


    lukin wrote: »
    I have an Access table with a field that I have to insert a lot of non-alphanumeric characters to. Example:
    (max([PLC00000015;VAR00001|Result;Result;*;enteredvalue],[PLC00000166;VAR00001|Result;Result])-min([PLC00000015;VAR00001|Result;Result;*;enteredvalue],[PLC00000166;VAR00001|Result;Result]))/mean([PLC00000015;VAR00001|Result;Result;*;enteredvalue],[PLC00000166;VAR00001|Result;Result])

    I have tried the memo field and the text field. Text doesn't work as it is more than 255 characters. Memo doesn't work either even though it should (the character restriction size with memo is 65535 characters I think).
    I think it has a problem with certain characters like "|" as some data that is not exactly like the example above goes into the table.
    It is with an embedded SQL statement in VBA I am attempting to insert it but even when I copy and paste the SQL into a query it doesn't go in either.
    That makes me think it is the table that is the problem.
    It is not an option for me to strip out characters that will not insert, everything has to go in.
    Any help will be greatly appreciated.

    Hi,
    Whats the error ?
    What happens when you manually try and add the data into the table in the datasheet view of access ?


  • Registered Users, Registered Users 2 Posts: 4,113 ✭✭✭lukin


    I haven't tried to insert it manually to the table but the error for both SQL and the query is "incorrect syntax" I think.
    Edit:"Syntax error in string in query expression"


  • Closed Accounts Posts: 317 ✭✭tiptap


    lukin wrote: »
    I haven't tried to insert it manullay to the table but the error for both SQL and the query is "incorrect syntax" I think.


    take it you don't have it handy there the database to try add it manually ?
    I'm sure it's just incorrect syntax alright..no reason why that data shouldn't go in if it's memo.
    if you want to post the db up here I can have a look


  • Registered Users, Registered Users 2 Posts: 4,113 ✭✭✭lukin


    tiptap wrote: »
    take it you don't have it handy there the database to try add it manually ?
    I'm sure it's just incorrect syntax alright..no reason why that data shouldn't go in if it's memo.
    if you want to post the db up here I can have a look

    I will post up the table and a module that contains the code I am doing the insert with. Give me a few mins.


  • Registered Users, Registered Users 2 Posts: 4,113 ✭✭✭lukin


    I have attached a db with the table that is causing the problem ("Calculation Rule" is the field it will not enter into). There is also a module with the code that I am doing the insert with.
    The code actually inserts from an Excel sheet (an example of which I have also attached). That doesn't really make a difference, you can try inserting just what won't go into the "Calculation Rule" field (turn off the primary key).
    "Calculation Rule" is memo datatype in that table and the SQL inserts what won't go in with single quotes. That is because I have tried it without single quotes, changed the datatype to text etc. nothing work.
    It's kind of important I sort it.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 4,113 ✭✭✭lukin


    It looks like I will have to cop and paste the fields in one go from the Excel sheet into the table. Not really the way I want to do it but still.


Advertisement