I am having trouble INSERTing cyrillic characters in an Access db via asp.
I can list cyrillic data fine.

I have

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


for the charset on the page but gibberish is inserted when adding data to
db. English can be inserted fine as well.

Anyone know a solution ?


thanks

Re: INSERTing cyrillic characters in Access db via ASP ? by Beast

Beast
Mon Jan 19 23:42:51 CST 2004

Beast <chris@peratinos.org> wrote in
news:Xns947651D994Abeastrrcom@199.45.49.11:

> I am having trouble INSERTing cyrillic characters in an Access db via
> asp. I can list cyrillic data fine.
>
> I have
>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
>
>
> for the charset on the page but gibberish is inserted when adding data
> to db. English can be inserted fine as well.
>
> Anyone know a solution ?
>
>
> thanks
>

I am also having troube UPDATEing cyrillic characters in records via ASP.

Re: INSERTing cyrillic characters in Access db via ASP ? by ljb

ljb
Tue Jan 20 09:08:00 CST 2004

I solved a similar situation by hex encoding and saving in a string field.
If you look at the DB it is encoded but the ASP decodes and encodes as
needed.

Function StringToHex(ByRef pstrString)
Dim llngIndex
Dim llngMaxIndex
Dim lstrHex
llngMaxIndex = Len(pstrString)
For llngIndex = 1 To llngMaxIndex
lstrHex = lstrHex & Right("0" & Hex(Asc(Mid(pstrString, llngIndex, 1))),
2)
Next
StringToHex = lstrHex
End Function

Function HexToString(ByRef pstrHex)
Dim llngIndex
Dim llngMaxIndex
Dim lstrString

if isnull(pstrHex) then exit function

llngMaxIndex = Len(pstrHex)
For llngIndex = 1 To llngMaxIndex Step 2
lstrString = lstrString & Chr("&h" & Mid(pstrHex, llngIndex, 2))
Next
HexToString = lstrString
End Function

"Beast" <beast@rr.com> wrote in message
news:Xns94767441CB74beastrrcom@199.45.49.11...
> Beast <chris@peratinos.org> wrote in
> news:Xns947651D994Abeastrrcom@199.45.49.11:
>
> > I am having trouble INSERTing cyrillic characters in an Access db via
> > asp. I can list cyrillic data fine.
> >
> > I have
> >
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> >
> >
> > for the charset on the page but gibberish is inserted when adding data
> > to db. English can be inserted fine as well.
> >
> > Anyone know a solution ?
> >
> >
> > thanks
> >
>
> I am also having troube UPDATEing cyrillic characters in records via ASP.



Re: INSERTing cyrillic characters in Access db via ASP ? by Beast

Beast
Wed Jan 21 15:17:40 CST 2004

Beast <chris@peratinos.org> wrote in
news:Xns947651D994Abeastrrcom@199.45.49.11:

> I am having trouble INSERTing cyrillic characters in an Access db via
> asp. I can list cyrillic data fine.
>
> I have
>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
>
>
> for the charset on the page but gibberish is inserted when adding data
> to db. English can be inserted fine as well.
>
> Anyone know a solution ?
>
>
> thanks
>

Can you tell me how to add this to my code. I have 5 fields to insert and
update to the db. I don't understand how to use the code you have given
me. For example, I have fields Title, Author, Description, Format, and
Publisher. How do I incorporate your code ?

thanks

Re: INSERTing cyrillic characters in Access db via ASP ? by ljb

ljb
Mon Jan 26 07:57:06 CST 2004

To display the value from the database in a text box

Values = Rst.GetRows
For Fld = 0 to ubound(Values,1)
Response.Write "<INPUT TYPE=""TEXT"" NAME=""Desc""
Response.Write "VALUE=""" & HexToString(Values(Fld,0)) & """>"


To prepare to place the text box value into the database

Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Cnn
Cmd.CommandTimeout = execTimeout
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "sp_update"
Cmd.Parameters.append Cmd.CreateParameter( _
"@fld", _
adVarChar, _
adParamInput, _
2, _
StringToHex(Request.Form("Desc")))
Cmd.Execute ,,adExecuteNoRecords

"Beast" <beast@rr.com> wrote in message
news:Xns9477A5C058F0Ebeastrrcom@199.45.49.11...
> Beast <chris@peratinos.org> wrote in
> news:Xns947651D994Abeastrrcom@199.45.49.11:
>
> > I am having trouble INSERTing cyrillic characters in an Access db via
> > asp. I can list cyrillic data fine.
> >
> > I have
> >
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> >
> >
> > for the charset on the page but gibberish is inserted when adding data
> > to db. English can be inserted fine as well.
> >
> > Anyone know a solution ?
> >
> >
> > thanks
> >
>
> Can you tell me how to add this to my code. I have 5 fields to insert and
> update to the db. I don't understand how to use the code you have given
> me. For example, I have fields Title, Author, Description, Format, and
> Publisher. How do I incorporate your code ?
>
> thanks