473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

sql and asp getting an error after changing to sql 2005 syntax diff?

I am uploading a file renaming it with text from input here is the sql insert code and error im getting. If you need more of the code let me know..

This exact code is working when inserting into SQL 2000
I duplicated the table script and ran it on SQL2005 with success and trying to get the code to now write to SQL2005 I have only change the connection string...

suggestions?



001.PDF File successfully written to disk.
ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/policyManagement/formPost.asp, line 11



code =

Expand|Select|Wrap|Line Numbers
  1.  If uploadObj.SaveToWeb("fileInput", uploadString) Then 
  2.  
  3.                 Response.Write("File successfully written to disk.")  
  4.                 %><!--#include file="../Connections/policyMngDB.asp"--><%
  5.                 formName = replace(formName,"'","''")
  6.                 sql = "insert into formList "
  7.                 sql = sql & "(formName, formNumber, uploadDate, userid, formStatus, fileName) "
  8.                 sql = sql & "values('"& formName &"', '" & formNumber &"', '"& now &"', '"& session("loggedInUserid") &"', '1', '"& newFileName &"') "                                            
  9.  
  10.                 set recordset = Server.Createobject("ADODB.RecordSet")
  11.                 recordset.open sql, conn, 3, 3
  12.  
  13.                 response.redirect("formView.asp")    
  14.  
  15.             Else 
  16.                 Response.Write("There was an error saving the file to disk.") 
  17.             End If 
  18.  
  19.          End If 
  20.  
  21.  
  22.  
Mar 12 '08 #1
1 1339
jhardman
3,406 Expert 2GB
cw,

Try adding data in a recordset, this will at least show you where you have a problem:
Expand|Select|Wrap|Line Numbers
  1. sql = "SELECT * FROM formList"
  2.  
  3. set recordset = Server.Createobject("ADODB.RecordSet")
  4. recordset.open sql, conn, 3, 3
  5.  
  6. recordset.addnew
  7. recordset("formName") = formName
  8. recordset("formNumber") = formNumber
  9. recordset("uploadDate") = now() ' I can never remember which dbs require dates
  10.    'be entered as '3/17/08' and which as #3/17/08#, this is potentially where the 
  11.    'problem was
  12. recordset("userid") = session("loggedInUser")
  13. recordset("formStatus") = "1" '1 should not be in quotes if it is a numerical field
  14.    'this is potentially where the problem was
  15. recordset("fileName") = newFileName
  16. recordset.update
Let me know if this helps.

Jared
Mar 17 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Aloof | last post by:
Using Access 2000 Windows Server 2003 The following code worked fine until we moved hosting companies StartDate = Request.Form("StartDateMonth") & "/" & Request.Form ("StartDateDay") & "/" &...
0
by: BobRoyAce | last post by:
I just got Visual Studio 2005 and am trying to create a new Windows application for the first time with it. I previously created a new web application (from the Start page) and closed out of VS...
1
by: obastard | last post by:
Hi Having a problem with a ms sql 2000 server. The script below was created i SQL manager 2005 lite and gives a syntax error near '(' ALTER TABLE . ADD CONSTRAINT PRIMARY KEY CLUSTERED ()...
7
by: HW | last post by:
Hi I have the following code, (it reads from th paralel port.) but I get the following error unexpected EOF while looking for matching `"' here is the code #include <stdio.h> #include...
9
by: i | last post by:
#include<stdio.h> #include<conio.h> #include<process.h> #include<string.h> char ch; int n,m; void main(); char check(int,int,char); void cash(int,int,char); void debit_card(int,int,char);
1
by: bbawa1 | last post by:
Again thanks a lot but When I execute only this portion it gives me error Syntax error converting the varchar value '2d 0h 0m' to a column of data type int. My stored procedure is the...
2
by: yalbizu | last post by:
#include <iostream> #include <string> #include <fstream> #include <iomanip> using namespace std; const int NO_OF_STUDENTS=20; struct studentType { string studentFName; string studentLName;
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.