473,382 Members | 1,743 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,382 software developers and data experts.

C# to ASP to ACCESS having Charest conversion difficulties


Hi,
I am still having Charest conversion
difficulties s when passing string from C# TO ASP and than to access using
ADO
I am using HttpWebRequest to POST some Multilanguage(Hebrew and English)
to an ASP page which in turn uses ADO to save them to an access data base
the access data base support(as I underatdn( UNICODE strings),I can insert
Hebrew string fro access IDE)
Here is the code which create the POST request

//Executing POST command

string strPost=string.Format(
"GUID={0}"+
"&UserPassword={1}"+
"&Email1Address={2}"+
"&Email2Address={3}"+
"&Department={4}"+
"&FirstName={5}",
Guid,
UserPassword,
Email1Address,
Email2Address,
HttpUtility.UrlEncode(Department),
HttpUtility.UrlEncode(FirstName))

HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Method = "POST";
byte[] data = Encoding.UTF8.GetBytes(strPost);
objRequest.ContentLength = data.Length;
objRequest.ContentType = "application/x-www-form-urlencoded";
try
{

System.IO.Stream stream=objRequest.GetRequestStream();
stream.Write(data,0,data.Length);
stream.Close();
}
catch(Exception e)
{
Console.Write(e.Message);
return false;
}

HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()) )
{
result = sr.ReadToEnd();
sr.Close();
}
return result.ToLower().IndexOf("true")!=-1;
}

and here is the ASP code which save the data the the data base

///The ASP which process the request

<%@ Language=VBScript %>
<%Option explicit
Response.Buffer=TRUE%>
<object RUNAT="server" PROGID="ADODB.Recordset" id="rs"></object>
<object RUNAT="server" PROGID="ADODB.Connection" id="conn"></object>
<%
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"

//Just create the SQL UPDATE query

SqlString="update Graduates set "
for each i in Request.Form
SqlString = SqlString & i & " = " & RemoveNullNumber(Request.Form(i),0) &
","
next
SqlString= mid(SqlString,1,len(SqlString)-1)
SqlString=SqlString & " where [Password]= '" & Request.Form("GUID") & "'"
conn.Execute SqlString,rsAffected
conn.Close
if rsAffected=0 then
Response.Write SqlString
else
Response.Write "True"
end if
Response.End
%>
When display the result in a web page i see gibberish for records which was
entered using the ASP page
and Hebrew for records which entered using access IDE

I tried several encoders with no luck.

Thanks in advance for any help
Nov 17 '05 #1
0 1192

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: John Phelan | last post by:
I read an article by, by Mike Groh, in Access-VB-SQL Advisor Magazine, Week 37 that concerns me quite a bit on distributing Access Applications commercially. First I need to describe a "commercial...
2
by: Jeff | last post by:
Does anyone know of any potential problems running a 2000 database with 2003? Also, what about installing all other Office products as 2003 versions but leaving Access as 2002 running a 2000...
1
by: ghero180 | last post by:
I am having great difficulties trying to import rich text files to Access. I am using Visual Basic 6. My problem is that the code I am using will read some of the file perfectly, but then skip...
35
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 =...
34
by: Mathieu Trentesaux | last post by:
Hello I downloaded Office 2007 for this reason : It seems, once again, that it is impossible to save any modification done in a VBA library, from the main project in Access. The save button...
5
by: Anns via AccessMonster.com | last post by:
My establishment has about 20 ms access db's that will be converted over (see subject). When we pull all the BE's over to SQL and the FE's on Sharepoint (.net) surely we don't have to change...
8
by: reema via AccessMonster.com | last post by:
Did any one faces any difficulties ,issuess or problems using Microsoft Access -- Message posted via http://www.accessmonster.com
64
by: John | last post by:
Hello there, Im cursing my place of employment...and its taken me a month to realise it... The scenario: Ive just stepped into a role to migrate an access database to VB.Net. The access...
3
by: prakashwadhwani | last post by:
I have just been asked to port an Access 97 app from an old Pentium 3 to a new Pentium Core-2-Duo PC. On the new PC, Office 2003 is installed. On opening the database, Access provided me with an...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.