473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ASP/ADODB - Memo fields and richtext format

3
Hi! i'm new here.
this place looks nice so i would like to try my luck here!

I've a question :
How can I insert multiline richtext into MSACCESS database?
at first I thought I could store it into a memo field, but it seems that i'm doing something wrong since it's crashing with the exception : INSERT INTO sql syntax is invalid.

(The DB, tables and fields name were double-checked)

Here's the dreaded code :
Expand|Select|Wrap|Line Numbers
  1. Set con = Server.CreateObject("ADODB.Connection")
  2.  
  3.         con.Open logins
  4.  
  5.         msg_id = 1 'for testing purpose only
  6.  
  7.         SQL_query = "INSERT INTO msg_inbox VALUES(" & msg_id & ", '" & request("destinataire") & "', '" & Session("username") & "', '" & date() & "', '" & request("message") & "'"
  8.  
  9.         Set RS = Server.CreateObject("ADODB.Recordset")
  10.  
  11.         RS.Open SQL_query, con, 0, 3
  12.  
-=-=-=-=-
In the SQL query :
values -> msg_id, as the message id (Daahh) numeric value
request("destinataire") as a string
Session("username") as string
Date() as string (didn't want to bother with formatting)
request("message") as MEMO in ACCESS and as textarea in HTML

thanks for your help guys!
rs.Close()
con.Close()
Oct 14 '07 #1
5 2925
MMcCarthy
14,534 Expert Mod 8TB
You forgot the closing bracket on your insert statement.

Expand|Select|Wrap|Line Numbers
  1.         SQL_query = "INSERT INTO msg_inbox VALUES (" & msg_id & ", '" & request("destinataire") & "', '" & Session("username") & "', '" & date() & "', '" & request("message") & "')" 
  2.  
Oct 14 '07 #2
Jahren
3
god... How can I be so dumb lol
i'll try and retrieve the data FROM the DB now and see what happens
Oct 14 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
god... How can I be so dumb lol
i'll try and retrieve the data FROM the DB now and see what happens
LOL!

We've all been caught. Its very easy to notice it in someone elses code but difficult to see in your own.
Oct 14 '07 #4
Jahren
3
read works llike a charm.
My new internal PM system is up and running, thanks alot
Oct 15 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
read works llike a charm.
My new internal PM system is up and running, thanks alot
You're welcome!
Oct 15 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm trying to input data from strings to a memo field. I would like to know how to check first to see if there is text there currently and if so...
4
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary...
24
by: deko | last post by:
I have an mdb (2002 file format) that uses memo fields extensively. I've read a lot about how problematic memo fields can be and that avoiding them is a good idea. But I'm stuck with them and was...
8
by: Taffman | last post by:
I've searched this goup for an answer to this, there are many discussions that come close but non that I can find that actually addresses this particular problem. I'm exporting queries to Excel....
7
by: midlothian | last post by:
Does using CStr on a memo field truncate it to 255 characters? Seems like this is happening with some data in my tables. Is there a way around this?
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
10
by: ARC | last post by:
This is mainly a speed question. In this example: I have a QuotesHdr table that has a few memo fields. If these memo fields are used extensively by some users, and if their are a large number of...
7
by: anthony | last post by:
Is there any way that individual words or phrases can be formatted within a memo field? Obviously, the whole field can have formatting applied but I'm interested in being able to format just part...
2
by: steph | last post by:
I have a table with 250 fields. Of course you are wondering why 250 fields... what could I possibly be storing in so many fields? I am using this table as a general import table for files that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.