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

Home Posts Topics Members FAQ

ASP insert

1 New Member
Hi there

This has probably been touched on a few times in here previously but after searching this forum and google I have not found an answer. And online tutorials seem useless and don't help me.

I am writing some ASP to connect to my SQL database - both on the same server, but on different HDDs. I have created a form and am now writing the insert page. I am copying the code from an existing form and insert page that works fine. I'll copy the code I am trying to recreate below:

Expand|Select|Wrap|Line Numbers
  1. <!--#include virtual="/DBconns/connTACSupport.asp"-->
  2. <%
  3.     set oUpload = server.createobject("ASPUpLoad.clsUpload")
  4.  
  5.     If oUpload.Form("RequestDesc") = "" Then
  6.         Response.Redirect "newticket.asp?error=true"
  7.     End If
  8.  
  9.     Dim strFileName, Requester, Department, RequestDesc, TicketStatus
  10.  
  11. strFileName = oUpload.FileName
  12. Requester = oUpload.form("ID")
  13. Username = Session("LOGON_USER")
  14. Department = oUpload.form("DeptID")
  15. RequestDesc = oUpload.form("RequestDesc")
  16. Cause = oUpload.form("Cause")
  17. Resolution = oUpload.form("Resolution")
  18. TicketStatus = "Open"
  19. EngineerDetail = "Ticket Opened"
  20. ScreenShot = "Screenshot"
  21.  
  22. ' insert ticket into tbltickets
  23. insertTicket = "INSERT INTO tblTickets (Requester, Username, Department, TicketStatus) VALUES ('" & Requester & "', '" & Username & "', '" & Department & "', '" & TicketStatus & "')"
  24.     connTACSupport.execute(insertTicket)
  25.  
Now this does not include any connection open strings but when I create the same thing with different fields, it says:

Expand|Select|Wrap|Line Numbers
  1. Microsoft VBScript runtime error '800a01a8' 
  2.  
  3. Object required: 'connTACSupport' 
  4.  
I have tried adding a line like this instead:

Expand|Select|Wrap|Line Numbers
  1.  data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _ 
  2.             Server.MapPath("tblcontractreview")
  3.  
  4. sql_insert = "INSERT INTO tblContracts (Requester, Username, Director, Department, TicketStatus) VALUES ('" & Requester & "', '" & Username & "', '" & Department & "', '" & Director & "', '" & ContractStatus & "')"
  5.  
But I don't know what to put in the Server.MapPath would be as it is on a different drive.

Any thoughts anyone?

Thanks in advance!
Jul 31 '07 #1
1 1692
jhardman
3,406 Recognized Expert Specialist
But I don't know what to put in the Server.MapPath would be as it is on a different drive.

Any thoughts anyone?

Thanks in advance!
you don't need a mapPath statement, you just need the actual file path beginning with drive letter. alternatively you can create a DSN entry (in your settings --> administrative tools --> data sources) and just refer to that in your data source. I'm not sure I could walk you through making a DSN, but you could google that. If I remember right, w3schools.com has a database tutorial under "ado" which covers a lot of it.

Personally, I dislike using insert statements, I would rather use Select statements along with "addnew", and I wrote an article about how to use that to insert a new record in a db in the articles section, but that is just my own preference.

Jared
Aug 2 '07 #2

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

Similar topics

3
2499
by: Howard Hinnant | last post by:
I recently asked for a survey of multimap insert with hint behavior, in support of a paper I'm writing concerning lwg issue 233. My sincere thanks to Beman Dawes, Raoul Gough, Russell Hind, Bronek...
6
6969
by: Mark P | last post by:
Some time ago I posted here about inserting into a set with a hint: ...
14
4269
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
16
16977
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
8
6275
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
4
5465
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
2
3169
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
3
2300
by: MP | last post by:
Hi Posted this several hours ago to another ng but it never showed up thought i'd try here. using vb6, ado, .mdb, jet4.0, no access given table tblJob with field JobNumber text(10) 'The...
6
3706
by: lenygold via DBMonster.com | last post by:
Hi everybody: What is the best way to I have 10 tables with similar INSERT requiremnts. INSERT INTO ACSB.VAATAFAE WITH AA(AA_TIN, AA_FILE_SOURCE_CD, .AA_TIN_TYP) AS ( SELECT AA_TIN,...
1
2642
by: EJO | last post by:
with sql 2000 enterprise Trying to build a stored procedure that will take the rows of a parent table, insert them into another table as well as the rows from a child table to insert into...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7161
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
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,...
0
7539
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...
1
7101
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...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
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...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
456
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...

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.