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: -
<!--#include virtual="/DBconns/connTACSupport.asp"-->
-
<%
-
set oUpload = server.createobject("ASPUpLoad.clsUpload")
-
-
If oUpload.Form("RequestDesc") = "" Then
-
Response.Redirect "newticket.asp?error=true"
-
End If
-
-
Dim strFileName, Requester, Department, RequestDesc, TicketStatus
-
-
strFileName = oUpload.FileName
-
Requester = oUpload.form("ID")
-
Username = Session("LOGON_USER")
-
Department = oUpload.form("DeptID")
-
RequestDesc = oUpload.form("RequestDesc")
-
Cause = oUpload.form("Cause")
-
Resolution = oUpload.form("Resolution")
-
TicketStatus = "Open"
-
EngineerDetail = "Ticket Opened"
-
ScreenShot = "Screenshot"
-
-
' insert ticket into tbltickets
-
insertTicket = "INSERT INTO tblTickets (Requester, Username, Department, TicketStatus) VALUES ('" & Requester & "', '" & Username & "', '" & Department & "', '" & TicketStatus & "')"
-
connTACSupport.execute(insertTicket)
-
Now this does not include any connection open strings but when I create the same thing with different fields, it says: -
Microsoft VBScript runtime error '800a01a8'
-
-
Object required: 'connTACSupport'
-
I have tried adding a line like this instead: -
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
-
Server.MapPath("tblcontractreview")
-
-
sql_insert = "INSERT INTO tblContracts (Requester, Username, Director, Department, TicketStatus) VALUES ('" & Requester & "', '" & Username & "', '" & Department & "', '" & Director & "', '" & ContractStatus & "')"
-
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!
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
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
by: Mark P |
last post by:
Some time ago I posted here about inserting into a set with a hint:
...
|
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...
|
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...
|
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...
| |
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...
|
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 :...
|
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...
|
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,...
|
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...
|
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,...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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...
| |