Showing posts with label writing. Show all posts
Showing posts with label writing. Show all posts

Sunday, March 25, 2012

ASP writing data to SQL Server 2000

I am having a problem with an ASP program that inserts data into a table on
SQL Server 2000.

No error msg is returned upon submission and the confirmation msg that
displays after the commit command is sent to the server displays, but when
we go to the DB, the data sent isn't there. This is an occassional
occurance and usually the data is there, just some times, it isn't. Other
forms function just fine, using the *exact* same file to perform the submit
function (all the forms "include" the same submit page). The only
difference we can find is a trigger on the table having problems which
executes upon update, capturing the information about who updated the record
when. From what we can see, this is the only programmatic difference. The
other thought tickling our minds was the possiblity of a simultaneous
submission, since all the users submit with the same db user name via the
form, if user 1's data gets written but not yet commited, user 2's data is
submitted, then the commit transaction is submitted by user 1 as the program
steps run in sequence, would the commit by user one cause eiither of the
records inserted but not commited to be lost? If so, why wouldn't that be causing problems on other forms ...Can you post some of the code that is being used? Particularly the trigger code... Also, use profiler to watch what is being sent to the SQL Server to determine if it is a SQL issue, or a ASP code issue.|||

Thank you Louis,

I will look into getting profiler turned on.

The trigger is as follows (specific variables replaced with generic names):

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE TRIGGER [trig_Table_doUpdateTimestamp] ON [dbo].[Table_1_0]
FOR UPDATE
AS
set nocount on
declare @.var1 datetime
declare @.var2 varchar(50)
declare @.var3 varchar(50)
declare @.var4 varchar(50)
declare @.var5 varchar(30)
set @.var1 = (select sourc_var1 from inserted)
set @.var2 = (select sourc_var2 from inserted)
set @.var3 = (select sourc_var3 from inserted)
set @.var4 = (select sourc_var4 from inserted)
set @.var5 = (select sourc_var5 from inserted)
update Table_1_0 set lastUpdateDT = getdate(), numberChanges = ( ( numberChanges + abs(numberChanges) ) /2 ) + 1 , lastupdateUser = SUSER_SNAME()
where sourc_var1 = @.var1 and sourc_var2 = @.var2 and sourc_var3 = @.var3 and sourc_var4 = @.var4 and sourc_var5 = @.var5
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

ASP upload image file

Im writing an asp page which allows users to upload files which are then
saved in a database table as an image. The problem is that the webpage is on
one server and the data is stored on another server, I can save the image to
the server the webpages are on but not the other, just get the error:
ADODB.Recordset error '800a0cb3'
Current Recordset does not support updating. This may be a limitation of the
provider, or of the selected locktype.
Is it possible to do this?
Chris,
is the db on the same internal network as the webserver?
if it is i dont think thats your problem, post some code.
Mike
www.michaelevanchik.com
"chris2583" wrote:

> Im writing an asp page which allows users to upload files which are then
> saved in a database table as an image. The problem is that the webpage is on
> one server and the data is stored on another server, I can save the image to
> the server the webpages are on but not the other, just get the error:
> ADODB.Recordset error '800a0cb3'
> Current Recordset does not support updating. This may be a limitation of the
> provider, or of the selected locktype.
> Is it possible to do this?
|||For Each File In Uploader.Files.Items
' Open the table you are saving the file to
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "select * from test",conn,2,2
RS.AddNew ' create a new record
RS("filename") = File.FileName
RS("filesize") = File.FileSize
RS("contenttype") = File.ContentType
' Save the file to the database
File.SaveToDatabase RS("filedata")
' Commit the changes and close
RS.Update
RS.Close
Next
All the servers are on the same internal network. I have an included asp
page which has the FileUploader class. This is the code that works, when I
change source parameter in the RS.Open line to the table on the other server
it fails on the RS.AddNew line.
"Michael Evanchik" wrote:

> Chris,
> is the db on the same internal network as the webserver?
> if it is i dont think thats your problem, post some code.
> Mike
> www.michaelevanchik.com
>
sql

ASP upload image file

Im writing an asp page which allows users to upload files which are then
saved in a database table as an image. The problem is that the webpage is on
one server and the data is stored on another server, I can save the image to
the server the webpages are on but not the other, just get the error:
ADODB.Recordset error '800a0cb3'
Current Recordset does not support updating. This may be a limitation of the
provider, or of the selected locktype.
Is it possible to do this?Chris,
is the db on the same internal network as the webserver?
if it is i dont think thats your problem, post some code.
Mike
www.michaelevanchik.com
"chris2583" wrote:

> Im writing an asp page which allows users to upload files which are then
> saved in a database table as an image. The problem is that the webpage is
on
> one server and the data is stored on another server, I can save the image
to
> the server the webpages are on but not the other, just get the error:
> ADODB.Recordset error '800a0cb3'
> Current Recordset does not support updating. This may be a limitation of t
he
> provider, or of the selected locktype.
> Is it possible to do this?|||For Each File In Uploader.Files.Items
' Open the table you are saving the file to
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "select * from test",conn,2,2
RS.AddNew ' create a new record
RS("filename") = File.FileName
RS("filesize") = File.FileSize
RS("contenttype") = File.ContentType
' Save the file to the database
File.SaveToDatabase RS("filedata")
' Commit the changes and close
RS.Update
RS.Close
Next
All the servers are on the same internal network. I have an included asp
page which has the FileUploader class. This is the code that works, when I
change source parameter in the RS.Open line to the table on the other server
it fails on the RS.AddNew line.
"Michael Evanchik" wrote:

> Chris,
> is the db on the same internal network as the webserver?
> if it is i dont think thats your problem, post some code.
> Mike
> www.michaelevanchik.com
>

Friday, February 24, 2012

arrays in tsql?

Hi;

I have been writing a lot of short tsql scripts to fix a lot of tiny
database issues.

I was wondering if a could make an array of strings in tsql that I
could process in a loop, something like

array arrayListOfTablesToProcess = { "orders", "phone",
"complaints"}

for( int i = 0; i < arrayListOfTablesToProcess.length; i++ )
delete from arrayListOfTablesToProcess[i]

Can you do something like this in tsql?

I should probably stop asking all of these questions.

Is there a good book on TSQL alone ( I'm not interested in wizards,
just scripting )...that is short?

SteveThere are no arrays in TSQL. You are thinking in terms of a procedural
solution rather than a set-based solution. In general, you should be able to
use a table and set-based, SELECT/UPDATE/DELETE statements to process
"lists" of data. If you define your problem more specifically someone here
may be able to help with the set-based solution.

--
David Portas
----
Please reply only to the newsgroup
--|||Hi

In addition to David's post check out:

http://www.algonet.se/~sommar/arrays-in-sql.html

John

"Steve" <stevesusenet@.yahoo.com> wrote in message
news:6f8cb8c9.0310040337.52427942@.posting.google.c om...
> Hi;
> I have been writing a lot of short tsql scripts to fix a lot of tiny
> database issues.
> I was wondering if a could make an array of strings in tsql that I
> could process in a loop, something like
>
> array arrayListOfTablesToProcess = { "orders", "phone",
> "complaints"}
> for( int i = 0; i < arrayListOfTablesToProcess.length; i++ )
> delete from arrayListOfTablesToProcess[i]
>
>
> Can you do something like this in tsql?
> I should probably stop asking all of these questions.
> Is there a good book on TSQL alone ( I'm not interested in wizards,
> just scripting )...that is short?
> Steve

Sunday, February 12, 2012

are there any MSDE T-SQL code limitations?

I am writing a database app which will run under MSDE on the user's systems.

Other than limitations as to the number of concurrent users, are there any
issues that I need to be aware of when programming the database using SQL
Server 2000? i.e., are there T-SQL programming statements that will run
under SQL Server 2000 as part of my development enviornemnt that won't run
under MSDE on the end users machines, or will MSDE handle anything that SQL
Server can from the database engine standpoint?

Thanks!hi Mike,
"Mike N." <BadDog@.thepound.com> ha scritto nel messaggio
news:r3erb.5780$942.4765@.newssvr25.news.prodigy.co m...
> I am writing a database app which will run under MSDE on the user's
systems.
> Other than limitations as to the number of concurrent users, are there any
> issues that I need to be aware of when programming the database using SQL
> Server 2000? i.e., are there T-SQL programming statements that will run
> under SQL Server 2000 as part of my development enviornemnt that won't run
> under MSDE on the end users machines, or will MSDE handle anything that
SQL
> Server can from the database engine standpoint?

all T-SQL statements SQL Server 2000 supports are supported by MSDE...
you only (only...) have database limitation size, limited replication
support, no mail support...
for further info please visit
http://www.microsoft.com/sql/msde/p...fo/features.asp

hth
Andrea Montanari (Microsoft MVP - SQL Server)
andrea.sql@.virgilio.it
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.4.0 - DbaMgr ver 0.50.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--- remove DMO to reply