SQL Everywhere, Ntext && ADO Classic
Jun 24, 2006
Hello!
I'm trying to move from MSDE to SQL Everywhere in my project, which requires using of ADO classic and i have some problems storing ntext data in SQLEv database using parametrized command.
Could it be that the problem is because of ADO classic? Is it ok to use old ADO with SQLEv OLEDB provider and will compatibility with old ADO be maintained in SQLEv?
Below is JScript code illustrating the situation:
-------------------------------
var oConn = new ActiveXObject("ADODB.Connection");
oConn.Open(sConnStr);
var oCmd = new ActiveXObject("ADODB.Command");
oCmd.ActiveConnection = oConn;
var sText = "test text";
oConn.Execute("create table tblTest(sText ntext)");
oCmd.CommandText = "insert into tblTest(sText) values(?)";
oCmd.Parameters(0).Value = sText;
oCmd.Parameters(0).Size = sText.length;
oCmd.Execute();
-------------------------------
It gives me 'Microsoft SQL Server 2005 Everywhere Edition OLE DB Provider: The given type name was unrecognized. [,,,,,]'.
If i remove 'oCmd.Parameters(0).Size = sText.length;' error changes to 'Insufficient memory to complete the operation.'
The same code works ok for MSDE and SQLExpress.
OS:Windowx XP SP2
MDAC version: 2.8
Many thanks!
View 3 Replies
ADVERTISEMENT
Nov 28, 2007
I am running this query to an sql server 2000 database from my aspcode:"select * from MyTable whereMySqlServerRemoveStressFunction(MyNtextColumn) = '" &MyAdoRemoveStressFunction(MyString) & "'"The problem is that the replace function doesn't work with the ntextdatatype (so as to replace the stresses with an empty string). I hadto implement the MySqlServerRemoveStressFunction, i.e. a function thattakes a column name as a parameter and returns the text contained inthis column having replaced some letters of the text (the letters withstress). Unfortunately, I could not do that because user-definedfunctions cannot return a value of ntext.So I have the following idea:"select * from MyTable whereCheckIfTheyAreEqualIngoringTheStesses(MyNtextColum n, '" & MyString &"')"How can I implement the CheckIfTheyAreEqualIngoringTheStessesfunction? (I don't know how to combine these functions to do what Iwant: TEXTPTR, UPDATETEXT, WRITETEXT, READTEXT)
View 2 Replies
View Related
May 14, 2007
I want to know if it is possible to connect from classic ASP to a SQL 2005 database, and if so, can someone provide a sample connection string, I'm not sure if it is my connection string or server config. Thanks, Ed.
View 5 Replies
View Related
Nov 16, 2005
Migrating a site to a new server. Moved data to SQLExpress. Changed connection string to point to SQLExpress and now I am getting this error.
Microsoft OLE DB Provider for SQL Server error '80004005'
Cannot open database "PHCSQL" requested by the login. The login failed.
/func/inc_DatabaseFunctions.inc, line 5 Do I need to do permissions differently than MSDE?Did connection strings change?Help?
View 1 Replies
View Related
Apr 28, 2006
hi,i'm using classic asp to try and connect to a sqlexpress database on a development server. i get the following error:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/dbtest.asp, line 8
I'm using the following script which runs fine against a regular SQL server (version 8) on the network.
<%@LANGUAGE="JAVASCRIPT"%>
<%
var strCon, conn, sql;
strCon = "Provider=SQLOLEDB.1;Data Source=localhost;Initial Catalog=rapidHB;User Id=rapid;Password=xxx";
conn=Server.CreateObject("ADODB.Connection");
conn.Open(strCon);
sql = "SELECT product_code FROM products WHERE product_type = 1";
var results= conn.Execute(sql).GetString();
Response.write(unescape(results));
%>
I have tried changing Data Source to servernameSQLEXPRESS, changing initial catalog to master, using a user name defined on the database and changing the provider to SQLNCLI but nothing has worked.
Anyone got any idea what I'm doing wrong? Using ASP.Net is not an option.
Rgds,
lukemack
View 9 Replies
View Related
Oct 6, 2007
Is there a way, other than simply changing the format of the SRS report, to create an old fashond Paged style report - similar to the ones you can get from Crystal Reports?
View 6 Replies
View Related
Aug 31, 2007
Hi All,
I'm having trouble getting at SQL Server 2005 Express via ASP code.
I'm using the following connection string in my ASP code:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn = "Provider = SQLNCLI;" & _
"Data Source = .SQLEXPRESS;" & _
"Initial Catalog = myDB;" & _
"User ID = DB_reader;" & _
"Password = a#koddkobn5;"
I keep getting the error:
Microsoft SQL Native Client (0x80004005)
Login failed for user 'DB_reader'. The user is not associated with a trusted SQL Server connection
I have made sure that the user exists in SQLEXPRESS and that server Security is set to SQL Server and Windows Authentication mode.
Can anyone think of anything I'm missing or that I should try?
We've lost our SQL Server admin and I'm trying to develop locally using Express while we hunt for a new admin.
Thanks so much for any assistance you have time to offer.
Very best,
Thom Cox
View 9 Replies
View Related
Feb 21, 2008
I have a Classic ASP page that provides me a view on Orders posted by customer for a selected month and year from a SQL Server 2000 database. This ASP page has a Stored Procedure that returns the orders posted by month and year. However, my needs are to be able to display the view by month, day and year to month, day and year, For example January 15, 2008 to February 14, 2008.
The current Classic ASP page has a dropdown to select the month and year from this dropdown only displays months and years for the months and years the customer had posted orders.
What I’d like to know is how to add to the classic asp page the means to input a date range on the fly that would return the report by month, day, year to month, day, year.
View 4 Replies
View Related
Apr 26, 2008
Classic problem..
Say I have two simple tables (one with members the other with status
changes):
CREATE TABLE [dbo].[member](
[memkey] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[mname] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[state] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[dob] [datetime] NULL,
[effective] [datetime] NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[memberstatuschange](
[memkey] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[transtype] [varchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,
[date] [datetime] NOT NULL
) ON [PRIMARY]
sorry missing referential for simple example.
select m.memkey,m.effective,s.transtype, s.date from member m left
join memberstatuschange s
on m.memkey = s.memkey
produces:
001 2006-11-01 00:00:00.000 1 2007-12-01 00:00:00.000
001 2006-11-01 00:00:00.000 2 2007-02-02 00:00:00.000
001 2006-11-01 00:00:00.000 1 2007-02-05 00:00:00.000
002 2006-11-02 00:00:00.000 1 2007-06-01 00:00:00.000
003 2006-11-03 00:00:00.000 1 2007-07-01 00:00:00.000
003 2006-11-03 00:00:00.000 2 2007-08-02 00:00:00.000
004 2006-01-01 00:00:00.000 NULL NULL
005 2007-01-01 00:00:00.000 NULL NULL
006 2007-02-05 00:00:00.000 NULL NULL
transtype 1 = stop, 2 = restart.
effective date marks the start the original start of membership. So
in the case of memkey 001 he started on 2006-11-01, stopped on
2007-12-01, restarted on 2007-02-02 and stopped again on 2/5/2007.
memkeys 004,005 and 006 don't have NO status changes.
presuming that we should never have a status code of restart without a
stop but that the data may have violations of that.
How can I query my tables to return every date of ACTIVE participation
during two dates?
So for example if I say give participations criterias of 11/7/2006
and 2/7/2007, it should pull two records for memkey 001 as follows
memkey, days, start, stop
001, 6, 11/1/2006, 11/7/2006
001, 2, 2/5/2007, 2/7/2007
Thank you for any help or information!!.
View 1 Replies
View Related
Aug 3, 2006
I am trying to return multiple recordsets to a classic ASP web page from SQL Server 2005 and then use GetRows() in ASP to fill 2 arrays with the data. I'm using a command object to run a stored procedure which performs 2 simple selects in SQL Server. The stored procedure works fine in SQL Server Management Studio so I'm guessing it's an ADO issue.
The ASP code looks like this: strConnect = "DRIVER={SQL Native Client};SERVER=MyServer.IsAtMyIsp.com;DATABASE=MyDb;UID=Me;PWD=MyPwd; MARS Connection=True;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = strConnect
conn.Open
Set objCommand = Server.CreateObject("ADODB.Command")
Set objRecordset = Server.CreateObject("ADODB.Recordset")
Set objRs = Server.CreateObject("ADODB.Recordset")
With objCommand
.ActiveConnection = conn
.CommandText = "sp_GetShowList"
.CommandType = adCmdStoredProc
If Len(strBeginDate) And IsDate(strBeginDate) Then
.Parameters.Append .CreateParameter("@i_DateStart",adDate,adParamInput,,strBeginDate)
If Len(strEndDate) And IsDate(strEndDate) Then
.Parameters.Append .CreateParameter("@i_DateEnd",adDate,adParamInput,,strEndDate)
End If
End If
End With
Set objRs = objCommand.Execute
arrEvents = objRs.GetRows()
objRs.NextRecordset
arrSched = objRs.GetRows()
The error message below occurs at the 2nd GetRows() command. Operation is not allowed when the object is closed.
Can anyone tell me what I might be doing wrong?
-Dan
View 3 Replies
View Related
Aug 20, 2006
I'm considering shifting my database server to 64-bit MS SQL Server 2005 for improved scalability and performance. I'm concerned, however, that my classic ASP website (which sits on a separate server) may have problems communicating via ADO/OLEDB because of communication problems between 32-bit IIS on the web server and 64-bit MS SQL Server on the database server.
My current set up (which works fine) is:
Web Server: Windows Server 2003, Standard Edition, SP1 - running IIS with a set of ASP websites
Database Server: Windows 2000 SP4, running MS SQL Server 2000
Connection String:
MyConnection="Provider=SQLOLEDB;Network Library=DBMSSOCN;SERVER=192.168.0.1;INITIAL CATALOG=MyDatabase;UID=MyUserID;PWD=MyPassword"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open MyConnection
My core question is:
If I change my database server to new machine with 64-bit Windows Server 2003 running 64-bit MS SQL Server 2005, will my (32-bit) web server be able to connect from ASP as it does now?
Thanks for your help!
Jed
View 2 Replies
View Related
Dec 17, 2006
Hello, We are re-writing our site in asp.net using sql server. Most of the site uses asp classic and it was to an access database. During the conversion we have everything working correct to SQL Server except for the asp.net connection string. There is an important part of the application using asp.net which works fine with our connection string to the access database. To recap our problem is the connection string from asp.net to sql server. This code works fine for the asp.net to access in the web.cnfg file </microsoft.web> <connectionStrings> <add name="SalesConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb" providerName="System.Data.OleDb"/> <add name="ODBCSalesConnectionString" connectionString="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb"/> <add name="RawConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb" providerName="System.Data.OleDb"/> <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|inventoryStatus.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings> <system.web> The code in the global.asa which works fine for classic asp to sql server also works fine and is as follows '--Project Data Connection Application("sales_ConnectionString") = "Driver={SQL Native Client};Server=DMSERVER01;Database=SQLsalesMain;UID=nTrack;PWD=nTrack2k3" Application("sales_ConnectionTimeout") = 15 Application("sales_CommandTimeout") = 30 Application("sales_CursorLocation") = 3 Application("sales_RuntimeUserName") = "" Application("sales_RuntimePassword") = "" Our programmer who set this up is out for a couple of weeks and I would appreciate any help in the correct connection string from asp.net to the sql server database in the web.cnfg file Thanks
View 5 Replies
View Related
Aug 13, 2004
Hello,
I have a project (using classic ASP & SQL Server) which adds one execute sql statement at a time to a temporary array, and then I join that array with a chr(30) (record separator), to a string variable called strSQL. I then run the following line of code:
conn.execute(strSQL)
I was wondering if there was any limitation to how large the strSQL variable can be? Reason I ask is because thru log writes I can see all of my sql execute lines exist in the variable strSQL prior to running the "conn.execute(strSQL)" command; however, not all of the lines run at the time of execution. Remember, this bug only is occuring whenever I have say over 600 sql lines to execute.
My understanding is that there was no limitation on the size of the string strSQL; however, in the interest of getting the bug fixed quick enough, I decided to just run a loop for each sql statment and run "conn.execute(strSQL)" every 50 times. This, in turn, has solved the problem and I do save all of my data; however, my original bug still exists.
Does anyone know why I have to split the sql commands and execute.com every 50 times instead of just being able to do it once ?
Please let me know. Thanks in advance.
View 8 Replies
View Related
Oct 1, 2007
Microsoft VBScript runtime error '800a01fb'
An exception occurred: 'EOF'
Used the same connection string and DSN (i.e pointing to the same database/server) in both environments. ASP works in Test Environment. Fails in Production Environment.
Test and Production have same versions of software.
Environment Details:
OS: Windows 2003 SP2
MDAC: 2.8
Database: HP Neoview
Any help appreciated.
Thanks,
Venkata.
View 1 Replies
View Related
Dec 1, 2005
I migrated my SQL Server 7 database to the new SQL Server 2005 that I installed on my PC. I have classic ASP programs on my PC that used to access the SQL Server 7 database. However, global.asa and these ASP programs can no longer connect to the new SS 2005 database.
View 9 Replies
View Related
Nov 1, 2007
Hello everyone. I'm stuck with what must be a common sql challenge.
I've got this single table that looks like this:
Store, Original Store, Product, Sale type, Method, Amount
There will be two product types (prodA and prodB)
There will be two Sale Types (New and Recharge)
There will be two Method (Cash and Credit)
The tricky part is I also need to report sales activity when a store
was the Original Store for a customer Recharge at another Store.
The report needs to look like this:
Store , Product, Cash New Total, Cash Recharge Total, Credit New
Total, Credit Recharge Total, Outside Recharge Total
Grouping/Totally on Store/Product.
In the above "Outside Recharges" means the Store was the Original store
and another store performed a recharge on it's customer.
Thanks for any help or information
View 3 Replies
View Related
Mar 26, 2006
The application is running ADO (MDAC) version 2.81.1117.0.
The application gets an recordset created by SQLServer by an select statement. In this case the recordset is empty.
The application adds a record to the recordset by AddNew(). Works fine. But when assigning the first field (smalldatetime in database) I get ADO error -2147217887.
I have inspected the recordset and I found a difference between the working one from SQLServer2000 and the new one from SQLServer2005: The Attributes item for the fields in the recordset has the flag adFldUnknownUpdatable set in the working SQL2000 version but is not set from SQL2005.
The database on SQL2005 is copied from the SQL2000 system and attatched to the SQL2005 system. I Have checket that the compability flag for the database on the SQL2005 system is set to SQL2000 compability.
Nils Nordenbrink
Winkonsult AB
Sweden
View 4 Replies
View Related
Dec 22, 2003
I wonder if I should do something to the data I store on ntext fields
so far it looks like it has no problem holding special chracters (as it should B for unicode)
anyway - is there some combinations I should avoid ?
Should I use something like on old ASP Server.URLEncode() or Server.HTMLEncode() ?
View 1 Replies
View Related
Mar 6, 2004
hi all,
I am new to sql server.
I need some help regarding ntext value.I am using an insert stored proc to insert the value into ntext field, till now i have been using a varchar variable to pass the value. but i think this doesn't work when the size exceeds the limit of varchar and also what if i want to perform group insert?
and the major issue i am concerned about is, i don't want to update this field quite often.I need to check whether the existing ntext value and the new value which i want to insert are different.I want to do it in a better way than processing both values entirely.I want to make sure that the update statement is executed only when both values differ.
View 1 Replies
View Related
Mar 18, 2004
HI all,
I Need some help over ntext datatype.one of my table columns is of ntext datatype. how to insert or update this thru storedprocs.
any special notes regarding ntext column.
View 1 Replies
View Related
Jul 20, 2005
If I insert 8000 byte of data, in the one of the column. now I want toread the data, is there any to see all the data, through selectstatement?
View 3 Replies
View Related
Jun 20, 2006
Hi, I'm using a column (ntext) to store some long strings. An example of the string that I need to store is the following:
436;Implementing A Gang - Awareness Program/And A Middle School
Gang Prevention Curriculum. Doctoral Th;Samuels;Donald J;Miami
IV;Administrators; At Risk; Child And Youth Studies; Community;
Community Members; Drop Out Prevention; Educational Leadership;
Law/Criminal Justice; Peer Counseling; Principals; Secondary Education
I wrote a store procedure that does it, but it seems that the column
space is not enough for the above string. The string in fact, is
truncated and only the following portion is stored in my table:
436;Implementing A Gang - Awareness Program/And A Middle School Gang
Prevention Curriculum. Doctoral Th;Samuels;Donald J;Miami
IV;Administrators; At Risk; Child And Youth Studies; Community;
Community Members; Drop Out Prevention; Educational Leadership
What can I do?
Christian
View 5 Replies
View Related
Jul 25, 2007
Hi, I have the following problem. I cannot alter column which is ntext under sql server 2000. I get the following error:25-Jul-2007 09:27:11 ERROR [sol.cm.dbsetup.StatementReader] Error occured while executing the statement: Cannot alter column 'asz' because it is 'ntext'. SQLState = S0001 ErrorCode = 492825-Jul-2007 09:27:11 ERROR [sol.cm.dbsetup.StatementReader] SQL statement was: ALTER TABLE a ALTER COLUMN asz NTEXT NOT NULL I cannot use varchar because it is to short. Please tell me if there is a magic way to do this. I've already read in documentation that I cannot alter column which is ntext. Is there really no way to do this. Please help :)
View 3 Replies
View Related
Jun 2, 2008
hi
i wants to order by ntext data type.
like
1.1.1.3.1.11.1.1.3.1.11.1.1.3.1.21.1.1.3.1.21.1.1.3.1.31.1.1.3.1.31.1.1.3.1.41.1.1.3.1.41.1.1.3.1.4.11.1.1.3.1.4.11.1.1.3.1.4.101.1.1.3.1.4.101.1.1.3.1.4.111.1.1.3.1.4.111.1.1.3.1.4.121.1.1.3.1.4.121.1.1.3.1.4.131.1.1.3.1.4.131.1.1.3.1.4.141.1.1.3.1.4.141.1.1.3.1.4.151.1.1.3.1.4.151.1.1.3.1.4.161.1.1.3.1.4.161.1.1.3.1.4.21.1.1.3.1.4.21.1.1.3.1.4.31.1.1.3.1.4.31.1.1.3.1.4.41.1.1.3.1.4.41.1.1.3.1.4.51.1.1.3.1.4.51.1.1.3.1.4.61.1.1.3.1.4.61.1.1.3.1.4.71.1.1.3.1.4.7
Thanks
Parth
View 3 Replies
View Related
Aug 15, 2001
I am working in asp and using sql server 7. I have a section where the input is to long to use a char field so i had to set the field as ntext. Now i am trying to do a section where i wanna look and see if the field is null and if not then it is to perform an operation. If it is null it is to skip and go to the next field in the record. However it is not performing this operation. It sees the first field and does pass the second one because it is null. If i put in a character into the field it will go on until it gets to a null again and then stops. Any suggestions?
View 2 Replies
View Related
Mar 12, 2003
I have come across a column in a database table where the
Data Type = 'ntext'
and the Length = '16'
Does this mean that a maximum of 16 characters can be entered into that column?
Bianca
View 1 Replies
View Related
Oct 26, 2005
Hallo. I need help, how pull out some inquiry string from type "ntext" in MS SQL(it is xml document). Sring has invariable length, in note is always on other position and includes variable text (e.g .:<actionId>xx</actionId>) . Position I can find out by the help of "patindex" but I don't know what then. I tryed to write procedures, but I had trouble with declaration variables (data type). Thanks and sorry for my horrible English.
View 6 Replies
View Related
Jan 15, 2004
Hello All,
Maybe a stupid question but I'm new to the db admin work so please bear with me.
I've imported an Access db into SQL, in the Access db the field type was 'memo' to accomodate the large amount of text (on avg ruffly 4100 chars. with spaces). Now in SQL the field in the table I have set up as an ntext field, which I understood to be equivalent to a memo field in Access.
My problem is when saving data to the field the first time it saves all the data correctly with the exception of the field in question. The data in the field is '<LongText>', now when I try to update the data in the table I get a 'Data Truncated' error message and no update takes place throughout the table.
After testing this and trying different things, I've found that if I shorten this one field and try to save to the db I still get the 'Data Truncated' error message. If I shorten the data in the field AND delete the record from the SQL table then it will save just fine from there on out (which won't work for the reports).
I'm not sure what I'm missing here to get this to work the way it did in Access.
View 11 Replies
View Related
Jun 1, 2004
Hi ...
I want define a ntext type variable and set the result of select from ntext field of table in that variable and Execute the variable .
Forexample :
Declare @A ntext
select @A=Fildntext from Table
set @A=@A+'string'
sp_executesql @A
Therefore how can i use ntext type??
thanks
View 1 Replies
View Related
Sep 27, 2005
I am new to SQL Server and would like to hear opinions on pros and cons of using nText vs. nVarChar data type for following uses:
URLs (up to 260 bytes)
Addresses (50-300 bytes)
Descriptions and comments (50-2,000 bytes)
Memos (up to 8000 bytes)
TIA.
View 8 Replies
View Related
Feb 6, 2007
Hello,
I need to save some news text in an SQL table. The text can be long.
1. Should I use nvarchar(MAX) or nText?
2. And what is the difference between nText and Text?
I am using SQL 2005.
Thanks,
Miguel
View 4 Replies
View Related
Oct 24, 2007
Hai, i need ur suggestion to use ntext in my table. basically i want to store the xml data(will be in same xml format only) in sql2000 database. the max size of the data will be 5mb.
so can i use ntext to store this data.basically, only once i insert the data to the database. no update after that. only i throw the query to retrieve that xml data from the database. is it advisable to use,ntext for this requirment. is there any other suggestion ??
help pls
View 2 Replies
View Related
Feb 15, 2008
Dear All,
i'm trying to convert the datatype from ntext to nvarchar.i'm getting error. is it not possible?
Vinod
Even you learn 1%, Learn it with 100% confidence.
View 3 Replies
View Related