473,756 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interesting question~

I find a interesting question, and I cannot solve it
@.@

If i want to insert unicode data, I need using recordset.addne w instead of
using "insert into table" query or "stored procedure"

All unicode data inserted into database through insert query or stored
procedure would become a question mark "?" no matter:
1. the field is nvarchar
2. the collpase is SQL_Latin_Gener al_CP1_XX_XX" or
"SQL_Latin_Gene ral_CP850_XX_XX "
3. the @codepage=65001
4. the charset of html page set to utf-8
5. or both above solution

That means i cannot hide my database structure by using stored procedure, i
need place ALL code inside asp and the asp become very heavy....

Any solution?

Thanks
Aug 9 '05 #1
8 2531
This is not true. Did you prefix the string with the N character?

CREATE PROCEDURE dbo.foo
@param NVARCHAR(255)
AS
BEGIN
SET NOCOUNT ON
INSERT table(column) SELECT @param
END
GO

Then from ASP:

conn.execute "EXEC dbo.foo @param = N'bar'",,129

This works for me just fine.

"ºa¤Ö@¤½¥q" <ºa¤Ö@¾ã»æ.¨p¤H ¤½¥q> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I find a interesting question, and I cannot solve it
@.@

If i want to insert unicode data, I need using recordset.addne w instead of
using "insert into table" query or "stored procedure"

All unicode data inserted into database through insert query or stored
procedure would become a question mark "?" no matter:
1. the field is nvarchar
2. the collpase is SQL_Latin_Gener al_CP1_XX_XX" or
"SQL_Latin_Gene ral_CP850_XX_XX "
3. the @codepage=65001
4. the charset of html page set to utf-8
5. or both above solution

That means i cannot hide my database structure by using stored procedure,
i
need place ALL code inside asp and the asp become very heavy....

Any solution?

Thanks

Aug 9 '05 #2
ºa¤Ö@¤½¥q wrote:
If i want to insert unicode data, I need using
recordset.addne w instead of using "insert into
table" query or "stored procedure"


Not if you use an ADODB.Command object:
http://msdn.microsoft.com/library/en...objcommand.asp

Extending Aaron's example (but with server-side JScript):

var CMD = Server.CreateOb ject("ADODB.Com mand")

CMD.ActiveConne ction = { your open connection object }
CMD.CommandType = adCmdStoredProc
CMD.CommandText = "foo"

CMD.Parameters. Append(
CMD.CreateParam eter(
"@Param",adVarW Char,adParamInp ut,255,YourValu e
)
)
CMD.Execute()
CommandTypeEnum :
http://msdn.microsoft.com/library/en...ndtypeenum.asp
DataTypeEnum:
http://msdn.microsoft.com/library/en...tatypeenum.asp
ParameterDirect ionEnum:
http://msdn.microsoft.com/library/en...ectionenum.asp

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Aug 9 '05 #3
What DBMS?

--
--Mark Schupp
"ºa¤Ö@¤½¥q" <ºa¤Ö@¾ã»æ.¨p¤H ¤½¥q> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I find a interesting question, and I cannot solve it
@.@

If i want to insert unicode data, I need using recordset.addne w instead of
using "insert into table" query or "stored procedure"

All unicode data inserted into database through insert query or stored
procedure would become a question mark "?" no matter:
1. the field is nvarchar
2. the collpase is SQL_Latin_Gener al_CP1_XX_XX" or
"SQL_Latin_Gene ral_CP850_XX_XX "
3. the @codepage=65001
4. the charset of html page set to utf-8
5. or both above solution

That means i cannot hide my database structure by using stored procedure,
i
need place ALL code inside asp and the asp become very heavy....

Any solution?

Thanks

Aug 9 '05 #4
yes~
I missed to mention it
I tried this way already

but still become question mark "?"
^.^

"Aaron Bertrand [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:ew******** ******@tk2msftn gp13.phx.gbl...
This is not true. Did you prefix the string with the N character?

CREATE PROCEDURE dbo.foo
@param NVARCHAR(255)
AS
BEGIN
SET NOCOUNT ON
INSERT table(column) SELECT @param
END
GO

Then from ASP:

conn.execute "EXEC dbo.foo @param = N'bar'",,129

This works for me just fine.

"ºa¤Ö@¤½¥q" <ºa¤Ö@¾ã»æ.¨p¤H ¤½¥q> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I find a interesting question, and I cannot solve it
@.@

If i want to insert unicode data, I need using recordset.addne w instead of using "insert into table" query or "stored procedure"

All unicode data inserted into database through insert query or stored
procedure would become a question mark "?" no matter:
1. the field is nvarchar
2. the collpase is SQL_Latin_Gener al_CP1_XX_XX" or
"SQL_Latin_Gene ral_CP850_XX_XX "
3. the @codepage=65001
4. the charset of html page set to utf-8
5. or both above solution

That means i cannot hide my database structure by using stored procedure, i
need place ALL code inside asp and the asp become very heavy....

Any solution?

Thanks


Aug 9 '05 #5
I am using MS SQL2000 standard edition
^.^

"Mark Schupp" <no******@email .net> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl...
What DBMS?

--
--Mark Schupp
"ºa¤Ö@¤½¥q" <ºa¤Ö@¾ã»æ.¨p¤H ¤½¥q> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I find a interesting question, and I cannot solve it
@.@

If i want to insert unicode data, I need using recordset.addne w instead of using "insert into table" query or "stored procedure"

All unicode data inserted into database through insert query or stored
procedure would become a question mark "?" no matter:
1. the field is nvarchar
2. the collpase is SQL_Latin_Gener al_CP1_XX_XX" or
"SQL_Latin_Gene ral_CP850_XX_XX "
3. the @codepage=65001
4. the charset of html page set to utf-8
5. or both above solution

That means i cannot hide my database structure by using stored procedure, i
need place ALL code inside asp and the asp become very heavy....

Any solution?

Thanks


Aug 9 '05 #6
This one I tried with error occurred
Example:
table: customer
field: name_tc nvarchar(10)

and I used command object to create parameter object and append to
adodb.command
and the type should be
set param = createParameter ("@NameTc", adVarWChar, adInputParam, 10,
variable_of_nam e)

but dont know why the server prompt something like the length of data I
provided is longer than the field's length....

Let me try again
^.^

"Dave Anderson" <GT**********@s pammotel.com> wrote in message
news:11******** *****@corp.supe rnews.com...
ºa¤Ö@¤½¥q wrote:
If i want to insert unicode data, I need using
recordset.addne w instead of using "insert into
table" query or "stored procedure"
Not if you use an ADODB.Command object:
http://msdn.microsoft.com/library/en...objcommand.asp

Extending Aaron's example (but with server-side JScript):

var CMD = Server.CreateOb ject("ADODB.Com mand")

CMD.ActiveConne ction = { your open connection object }
CMD.CommandType = adCmdStoredProc
CMD.CommandText = "foo"

CMD.Parameters. Append(
CMD.CreateParam eter(
"@Param",adVarW Char,adParamInp ut,255,YourValu e
)
)
CMD.Execute()
CommandTypeEnum :

http://msdn.microsoft.com/library/en...ndtypeenum.asp DataTypeEnum:
http://msdn.microsoft.com/library/en...tatypeenum.asp
ParameterDirect ionEnum:
http://msdn.microsoft.com/library/en...ectionenum.asp
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use of this email address implies consent to these terms. Please do not contact me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.

Aug 9 '05 #7
> but still become question mark "?"

How have you verified that this is what is STORED? It sounds like this is
what you see when you display it on your web page, but I am not convinced
that what is in the database is ?
Aug 9 '05 #8
Yes
I using MSSQL 2000 Enterprise Manager and query the database data
and it stored question mark as well
^.^

"Aaron Bertrand [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
but still become question mark "?"


How have you verified that this is what is STORED? It sounds like this is
what you see when you display it on your web page, but I am not convinced
that what is in the database is ?

Aug 10 '05 #9

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

Similar topics

2
1550
by: pythonUser_07 | last post by:
Is this the correct place to post a jython question? I posted the following in the jython group, but I figured I'd post here too: _________________________________________ I am assuming that the PythonInterpreter environment is not a unique environment from within a jvm. Here is some pseudo code to show what I am talking about 1) create a jython module file, lets call it "mytest"
2
4937
by: Dylan Phillips | last post by:
A strang error is occurring when I run the following code: SqlConnection c = new SqlConnection(); c.ConnectionString = "Initial Catalog=Northwind;user id=sa;password=kat1ie;Data Source=server"; c.Open(); SqlCommand command = c.CreateCommand(); command.CommandType = CommandType.Text; command.CommandText = "select Customers.customerid, customers.companyname, " +
7
3037
by: git_cs | last post by:
Hey, guys and gals Somedays ago, I had asked for the DES algorithm in C language. Although I have written the algorthim in C myself, I am facing a peculiar problem, which I hope some of u guys and gals solve. I use Turbo C++ version 3.0 and WINXP as the operating system. Pls observe the following program. 1 #include<stdio.h> 2 #include<conio.h>
7
1373
by: Jax | last post by:
I have this code, behold: string message = "Are you sure? You will lose this customer forever. (Well you'll have re-create from scratch)"; string caption = "Delete"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; result = MessageBox.Show(this, message, caption, buttons); if(result == DialogResult.Yes)
12
1426
by: Dino M. Buljubasic | last post by:
I have two applications App1 and App2. App1 is just checking for new version of App2. If it finds newer version of App2 it will download App1 AND App2. (both of them). That is what I am doing now in my application. I am downloading from an FTP server and I can see download progress. However, when the download is finished, App1 is not updated (which I understand, because its file is being locked in the process of update).
6
3902
by: Claude Yih | last post by:
Hi, everyone. I noticed an interesting thing about fread() this afternoon. Well, I can't see why so I post this message in the hope of getting some explanation. Please help me. I wrote the following code in Windows 2k and compiled it with the gcc(version: 3.2.3) contained in MinGW: #include <stdio.h> #include <stdlib.h> #include <string.h>
26
3646
by: v4vijayakumar | last post by:
Happened to see my old (last millennium) c code. Almost forgot that I wrote it . It is interesting. :-) int sqrt(int no) { int t; no = t * t; return t; }
5
1968
by: Will Honea | last post by:
I've hit an interesting trap trying to migrate data off an OS/2 server running version 7.2 (fp14) over to 8.2 on Linux. Seems that one table has a column defined in the DDL as "BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH +1, INCREMENT BY +2, NO CACHE)". Any rows in that table will kill db2move. EXPORT to IXF succeeds, but attempting to load/import the file refuses to load any rows. The really scary part is that this table...
126
4406
by: jacob navia | last post by:
Buffer overflows are a fact of life, and, more specifically, a fact of C. All is not lost however. In the book "Value Range Analysis of C programs" Axel Simon tries to establish a theoretical framework for analyzing C programs. In contrast to other books where the actual technical difficulties are "abstracted away", this books tries to analyze real C programs taking into account pointers, stack frames, etc.
0
10046
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9886
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.