473,539 Members | 3,073 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

probles executing SP in VBScript


Hi,

I am trying to execute a SP in VBScript. The SP is returning multiple
rows and it's working fine. When I try to execute it from VBScript I get
this error: "ADODB.Recordset: Operation is not allowed when the object
is closed."
This is the part of code:

Dim MyConn, cmd, myRec
Dim cc
Dim GLDate,GLAccount
Dim strSQL

Set MyConn = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.Command")
Set myRec = CreateObject( "ADODB.Recordset" )

MyConn.Open strConn

cmd.CommandText = "gldata_fo"
Set cmd.ActiveConnection = MyConn
cmd.CommandType = 4
cmd.Parameters.Refresh
cmd.Parameters("@Date") = "11/14/2005"
Set myRec = cmd.Execute
While Not myRec.EOF
GLDate=myRec.Fields(0).Value
GLAccount=myRec.Fields(1).Value

myRec.MoveNext

Wend
MyConn.Close()

What am I doing wrong ?
Please help.

Thanks,
Dan
*** Sent via Developersdex http://www.developersdex.com ***
Nov 23 '05 #1
1 917
"Dan Pavel" <my**************@yahoo.com> schrieb:
What am I doing wrong ?


You are posting to the wrong group. I suggest to give the groups below a
try:

<URL:news://news.microsoft.com/microsoft.public.scripting.wsh>
<URL:news://news.microsoft.com/microsoft.public.scripting.vbscript>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9146
by: Valentina Boycheva | last post by:
Is there a way to make programs written in these two languages communicate with each other? I am pretty sure that VBScript can access a Python script because Python is COM compliant. On the other hand, Python might be able to call a VBScript through WSH. Can somebody provide a simple example? I have exactly 4 days of experience in Python (and...
1
4993
by: Valentina Boycheva | last post by:
Thanks for the reply. I already have "Learning Python" from Mark Lutz and David Ascher, which covers 2.3 (I am in 2.4). However, it seems like heavy artillery to me. What I want is, for instance, run a VBScript to get a function output and feed it to the Python script that called it. The reason is that because I feel more comfortable with...
4
12661
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck Gatto Dan Guzman Apr 27 2000, 12:00 am show options
4
1576
by: gmail | last post by:
Hi all-- I'm new to HTML and scripts and am having a problem with some code, pasted in at the bottom. It uses javascript to get values from a form in another frame, stores part of an SQL string in a cookie, then uses vbscript to query a database. The page is reloaded by clicking a button in another frame. The problem I'm having is I...
3
4781
by: lbarrack | last post by:
I am writing a timepunch addition to an existing timecard web app using ASP and Internet Explorer tied to a SQL 7 backend. I have isolated enough of the problem down to what I think is trying to submit the statements without using the classic form/response schema. Here is a very dumbed down version of what I'm doing since I think the problem may...
1
1348
by: Airtech | last post by:
I am developing a database in Access 2002/2003 for use in Configuration Management. The application has reach the point where users of my application need to execute scripts in various formats. I know that I can use the Call Shell command to execute programs and batch files, but I cannot seem to find how I can execute a pre-existing vbscript. ...
3
2093
by: Kasper | last post by:
Hi Group. I have an old VB6 application which loads a number of gui controls from an inifile and for each control the inifile states the name of the vbscript that should be executed once the control is clicked or otherwise triggered. My question is whether it is possible to execute the vb scripts from C#? There are multiple scripts in the...
2
7462
by: Carlton Kirby | last post by:
I need to execute a job on a SQL Express 2005 instance (no SQLAgent). The job will be executed manually by a user, so it doesn't need to be scheduled to run automatically. I thought I could execute the job through a stored procedure, but it appears that SQL Agent is necessary even for that. The job was given to me by a software vendor to...
0
1817
by: ismailc | last post by:
Good day, I need help. I have an application that uses aspx pages together with vbscript window for developer coding. Now the page has an <input type='file'> upload object. The problem is that on the same page submit button i'm uploading the file AND executing vbscript command that renames & emails the file that is been loaded. It...
0
7310
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...
0
7537
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, 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. ...
0
7704
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7652
tracyyun
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...
0
4859
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3361
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...
0
3359
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1764
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
597
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.