I am trying to write to a text file and the database at the same time. I have a For statement that loops through all the repeated fields in my form and writes it to a text file. That part works 100% without a problem.
My problem is that I also want to write to the SQL database at the same time and anytime I put the sql stored procedure inside the same For statement I get a http 500 error. Do I need to do this outside of the current For statement or am I doing something incorrect?
Thanks! -
Dim fso, act
-
Dim sCon, strSQL
-
Dim rsProcess
-
set fso = createobject("scripting.filesystemobject")
-
Set act = fso.CreateTextFile(strServerpath&"new_"&strPart_number&strOutput_ext, true)
-
act.WriteLine "Date:,"&Date
-
act.WriteLine "Time:,"&Time
-
act.WriteLine "Carline Code:,"&strcarline
-
act.Writeline "Filter B:,"&strsub_system
-
act.writeline "GO Version:,"&intprod_ver
-
act.writeline "Hand:,"&strhandiness
-
act.writeline "LD Version:,1"
-
act.writeline "EI Level:,"&strei_level
-
act.writeline "DC Version:,"
-
act.writeline "Part Name:,"&strpart_name
-
act.writeline "Part Number:,"&strPart_number
-
act.writeline "Plant Code:,"&strplant_code
-
act.writeline "Sym Opp:,"&strsym_opp
-
act.writeline "WLRR:,"&intwlrr
-
act.writeline "LRR#:,"&intlrr
-
act.writeline "Concern:,"&strconcern
-
act.writeline "Operator:,"&strOperator
-
act.writeline "Type:,Component"
-
act.writeline
-
act.writeline "Label,X Value, Y Value, Z Value, I Value, J Value, K Value, Size 1, Size 2, Flag #, Sub Type, Subscript, selection set 1, PCA Note, Open Issue Note, Other Notes"
-
For intV=1 to total_points
-
strLabel = request.Form ("label"&intv&"")
-
intX_value = request.Form ("x_value"&intv&"")
-
intY_value = request.Form ("y_value"&intv&"")
-
intZ_value = request.Form ("z_value"&intv&"")
-
intI_value = request.Form ("i_value"&intv&"")
-
intJ_value = request.Form ("j_value"&intv&"")
-
intK_value = request.Form ("k_value"&intv&"")
-
intSize_1 = request.Form ("size_1"&intv&"")
-
intSize_2 = request.Form ("size_2"&intv&"")
-
strFlag_num = request.Form ("flag_num"&intv&"")
-
strSub_type = request.Form ("sub_type"&intv&"")
-
strSubscript = UCASE(request.Form ("subscript"&intv&""))
-
strSelection_set = request.Form ("selection_set"&intv&"")
-
strPca_note = request.Form ("pca_note"&intv&"")
-
strOi_note = request.Form ("oi_note"&intv&"")
-
strOther_note = request.Form ("other_note"&intv&"")
-
-
act.writeline strLabel&","&intX_value&","&intY_value&","&intZ_value&","&intI_value&","&intJ_value&","&intK_value&","&intSize_1&","&intSize_2&","&strFlag_num&","&strSub_type&","&strSubscript&","&strSelection_set&","&strPca_note&","&strOi_note&","&strOther_note
-
-
strSQL = "prInsertCompInfo '" & strLabel & "," & intX_Value & "," & intY_Value & "," & intz_value & "," & inti_value & "," & intj_value & "," & intk_value & "," & intSize_1 & "," & intSize_2 & "," & strFlag_Num & "," & strSub_type & "," & strSubscript & "," & strSelection_set & "," & strPca_Note & "," & strOI_note & "," & strOther_Note & "," & null & "'"
-
Set rsProcess = con.execute(strSQL)
-
-
Next
-
2 1653 jhardman 3,406
Recognized Expert Specialist
I don't know of any requirement, I've seen people write to two different dbs at the same time and I would think that is harder, but personally I would wait until the one is finished before starting the other. Specifically, I would do the db first, but maybe at the same time construct a very long string variable containing everything I want to add to the text file, then when I've finished with the db, write the text file all at once. Let me know if this helps.
Jared
Ended up not being anything with my statements or order of them. Was between the stored procedured and what I was trying to pass through it.
I love having deadlines that make you rush through stuff without looking at the simple things.
Thanks for the help though.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: lawrence |
last post by:
I've been bad about documentation so far but I'm going to try to be
better. I've mostly worked alone so I'm the only one, so far, who's
suffered from my bad habits. But I'd like other programmers...
|
by: C Gillespie |
last post by:
Dear All,
Hopefully I have a simple problem. Basically, I just want to alter some text
with JS.
Here is some of my test code:
<snip>
<script type="text/javascript">
var tmp='a';
|
by: pradeep_TP |
last post by:
Hi all,
I have a few questions that I have been wanting to ask for long. These are
all related to ADO.net and specifically to conenction to database.
1) If I have opened a connection to a...
|
by: John Salerno |
last post by:
The code to look at is the try statement in the NumbersValidator class,
just a few lines down. Is this a clean way to write it? i.e. is it okay
to have all those return statements? Is this a good...
|
by: Sean Davis |
last post by:
I am working on a simple script to read from one database (oracle) and
write to another (postgresql). I retrieve the data from oracle in
chunks and drop the data to postgresql continuously. The...
|
by: andy.z |
last post by:
If 2 people try to access the same text file at the same time to write to
it - what happens in PHP ?
What I mean is - presumably the first will be ok -
But what will the second person actually...
|
by: =?Utf-8?B?Smlt?= |
last post by:
I have code that reads and parses a text file using a schema.ini file. Works
great. When I see the dataGrid it's exactly what I want.
Dim CString As String = _...
|
by: cmrhema |
last post by:
Hi All ,
I have with me a server socket program, I am receiving all the clients, but what happens is i have to write it into a file.
This consumes time.
So we do not have a data loss, but as...
|
by: tshad |
last post by:
I have a program in 2005 that is reading a text file removing text and then
writing it back out again. It removes lines that start with PRINT.
This program has worked fine for months. Now all...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
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?
| |