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 1660 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 to have an
easier time understanding what I do. Therefore this weekend I'm going
to spend 3 days just writing comments. Before I do it, I thought I'd
ask other programmers what information they find useful.
Below is a typical class I've...
|
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 database through Connection.open()
method, and I do not use Connection.close() method, will garbage collector
collect the connection object just because i am not using it any more.
2) I am using a dataset, in which i make some modifications to the...
|
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 use of try? Etc.
Thanks.
----------------------------
import wx
|
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 author of one
of the python database clients mentioned that using one thread to
retrieve the data from the oracle database and another to insert the
data into postgresql with something like a pipe between the two threads
might make sense, keeping...
| |
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 see in his browser?
And what will php do about it if not specifically programmed to deal with
it
ie whats the default behaviour?
|
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 = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
|
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 the time taken to write into the log file increases, some of the data does not get written.
This is the code
//ONLY SHOBA
|
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 of a sudden, it is reading
a straight text file and adding a null after each character it reads in.
Why is that?
The original file doesn't have nulls in them. The code is:
********************************************
using System;
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |