Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

è turns ? when inputting in Db

Status
Not open for further replies.

Stoemp

Programmer
Sep 25, 2002
389
0
0
BE
Hi

I'm experiencing a terrible thing here. I made an online CRM solution with ASP and an access database. When inputtig names in the db using a form, the character è turns into a ?. This makes it very hard to find someone back in the DB. Can this be solved?

Thanks

Steven
 
A little mistake in reporting the error:

The form turns è in the HTML code:
Code:
è

How can I input the è really as an è in the db?

Thanks

Steven
 
in the html for display it will be changed to the text you denoted, if youpull the element and post it directly it shouldn't be changed on you, especially if the field in the db is ntext or unicode

[thumbsup2]DreX
aKa - Robert
 
Robert

I don't really understand what you're trying to say to me here. Can you please give an example?

The only thing I do is collect the data from a form, put it in a SQL string and execute the insert statement to the DB.

Thanks

Steven
 
ah sorry i missed the access db thing earlier, a regular text field should hold it, heck a text field will hold extended ascii, so you should be ok

can you post some sample?

[thumbsup2]DreX
aKa - Robert
 
Well, of what do you need a sample? I have a simple text field (input type="text"). The form gets submitted. On the submit page, I do a "Request.Form("nameOfTheField")" and put it in a string. This string is put in a SQL statement that inserts the data into the database.

I really can't see what I'm doing wrong here.

Could you please specify of which code you'd like to see examples?

Thanks in advance

Steven
 
like a response of the write to DB sql statement


[thumbsup2]DreX
aKa - Robert
 
Here's the SQL statement that inserts the data in the db:
Code:
INSERT INTO klant(titel, achternaam, voornaam, instituut, departement, adres, postcode, stad, land, telefoon, fax, email, krijgtCatalogi, opmerking, krijgtMailingPerTrefwoord, actief, datumToegevoegd, datumLaatsteWijziging, vertegenwoordiger, taalCode) VALUES('Dr.', 'Defrène', '', 'Eugène Instituut', '', 'rue Frère Dekèrle', '1000', 'Bruxelles', 'België', '', '', '', false, '', false, false, '14-jul-2004', '14-jul-2004', 'pieterd', 'FR')
 
may want to see if you can insert or use any of these other special chars :


and here's a thread on a similar topic :

and here's a page dealing with internal viewers not showing the information correctly, although in db ( like if you response.write it ) it's correct...

[thumbsup2]DreX
aKa - Robert
 
Thanks DreX, but I'm afraid this doesn't really solve my problem. The problem is that the characters show well in a web browser, but when the user e.g. searches for the city of 'Liège', he doesn't get any result because the city is in the database as 'Liège'. Also when I want to print labels for a mailing from the database, the é is replaced and doesn't show well on the label.

The problem is not that I can't insert special symbols in the database. When I just type them right into the database they remain there, but there seems to go something wrong when using SQL to insert the data in the database.
 
It sounds like there is something along the lines of HTMLEncode or a replace getting performed somewhere.

post the code that builds and executes the SQL query.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Here it is:
Code:
sSQL = "INSERT INTO klant(titel, achternaam, voornaam, functie, instituut, departement, adres, postcode, stad, land, telefoon, fax, email, website, krijgtCatalogi, opmerking, krijgtMailingPerTrefwoord, actief, klantNummer, datumToegevoegd, datumLaatsteWijziging, vertegenwoordiger, taalCode) VALUES('" & sTitel & "', '" & sAchterNaam & "', '" & sVoorNaam & "', '" & sFunctie & "', '" & sInstituut & "', '" & sDepartement & "', '" & sAdres & "', '" & sPostcode & "', '" & sStad & "', '" & sLand & "', '" & sTelefoon & "', '" & sFax & "', '" & sEmail & "', '" & sWebsite & "', " & sKrijgtCatalogus & ", '" & sOpmerking & "', " & sKrijgtMailings & ", " & sActief & ", '" & sKlantNummer & "', '" & MediumDate(Date(), "NULL") & "', '" & MediumDate(Date(), "NULL") & "', '" & sVertegenwoordiger & "', '" & sTaal & "')"

I know it's a bit messy, but it's just a long SQL statement.
 
right, saw that earlier in the thread. I was thinking more along the lines of the code that actually sets up the variables!



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Chris

Here's the code that gets all the information from the form that has been posted. Nothing special here in my opinion:
Code:
sTitel = Replace(Request.Form("titel"), "'", "''")
sAchterNaam = Replace(Request.Form("achternaam"), "'", "''")
sVoorNaam = Replace(Request.Form("voornaam"), "'", "''")
sFunctie = Replace(Request.Form("functie"), "'", "''")
sInstituut = Replace(Request.Form("instituut"), "'", "''")
sDepartement = Replace(Request.Form("departement"), "'", "''")
sAdres = Replace(Request.Form("adres"), "'", "''")
sPostcode = Replace(Request.Form("postcode"), "'", "''")
sStad = Replace(Request.Form("stad"), "'", "''")
sLand = Replace(Request.Form("land"), "'", "''")
sTelefoon = Replace(Request.Form("telefoon"), "'", "''")
sFax = Replace(Request.Form("fax"), "'", "''")
sEmail = Replace(Request.Form("email"), "'", "''")
sWebsite = Replace(Request.Form("website"), "'", "''")
sTaal = Request.Form("taal")
sVertegenwoordiger = Request.Form("vertegenwoordiger")
sKrijgtCatalogus = Request.Form("krijgtCatalogus")

sActief = Request.Form("actief")
If sActief = "on" Then
     sActief = "true"
     sKlantNummer = Request.Form("klantnummer")
Else
     sActief= "false"
     sKlantNummer = 0
End If

If sKrijgtCatalogus = "on" Then
     sKrijgtCatalogus = "true"
Else
     sKrijgtCatalogus= "false"
End If

sKrijgtMailings = Request.Form("krijgtMailings")
If sKrijgtMailings = "on" Then
     sKrijgtMailings = "true"
Else
     sKrijgtMailings= "false"
End If

sOpmerking = Request.Form("opmerking")

The SQL statement is executed with a simple 'conn.Execute(sSQL)

I hope this brings you further. If you need more information, please ask me.

Thanks for the effort!

Steven
 
I have a similar problem though I am typing in Vietnamese using UNICODE. The characters that get are displayed on the intranet must use the ũ notation. When these characters are entered through the intranet - the UNICODE code is saved in the database, not the visual representation. Again I am using very basic SQL statements and form fields as Stoemp is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top