473,657 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

executing stored procedure in vb Access97

Hi All,

I've a serious problem with executing stored procedures (SQL2000) from
an Access db (version 97). After executing a stored procedure ,
msaccess hangs. The whole call to the procedure is running fine, but
immediatly after this msaccess hangs, when the focus goes back to the
calling form ?
Has anyone any idea what i can test or look at.

Thanks a lot !!!!!!

CODE*********** **
Function DownloadData() 'This is the function executed when clicking
on a btn on form
Dim RetVal

RetVal = Execute_Procedu re("sp_Download Data", "", False)
MsgBox "All data has been downloaded "
'UNTIL EVERYTHING IS WORKING FINE BUT WHEN GOING OUT THIS FUNTION
THE ACCESS APPLICATION START USING 100% CPU AND HANGS

End Function


Public Function Execute_Procedu re(iProcedure As String, iArgs As
String, iIndicator As Boolean) As Boolean
Dim t1, t2
t1 = Timer

DoCmd.Echo False, "Executing procedure " & iProcedure & " " &
iArgs
Dim oCn As ADODB.Connectio n
Set oCn = New ADODB.Connectio n

oCn.ConnectionS tring = gCn
oCn.Open
oCn.CommandTime out = 0

Dim oCmd As ADODB.Command
Set oCmd = New ADODB.Command

oCmd.CommandTim eout = 0
oCmd.CommandTyp e = adCmdStoredProc

oCmd.CommandTex t = iProcedure & iArgs

oCmd.ActiveConn ection = oCn

oCmd.Execute , , adExecuteNoReco rds

oCn.Close

t2 = Timer

DoCmd.Echo False, iProcedure & " executed in " & CInt((t2 - t1)) &
" seconds"

Set oCmd = Nothing
Set oCn = Nothing

Execute_Procedu re = True

End Function
Nov 13 '05 #1
1 3142
Well, unless your code turns the echo back on, the echo is still off, and your
application will appear to hang. Turning the echo off is a somewhat sensitive
operation for this reason.

On 4 Aug 2004 23:58:11 -0700, rv**@skynet.be (rvdw) wrote:
Hi All,

I've a serious problem with executing stored procedures (SQL2000) from
an Access db (version 97). After executing a stored procedure ,
msaccess hangs. The whole call to the procedure is running fine, but
immediatly after this msaccess hangs, when the focus goes back to the
calling form ?
Has anyone any idea what i can test or look at.

Thanks a lot !!!!!!

CODE********** ***
Function DownloadData() 'This is the function executed when clicking
on a btn on form
Dim RetVal

RetVal = Execute_Procedu re("sp_Download Data", "", False)
MsgBox "All data has been downloaded "
'UNTIL EVERYTHING IS WORKING FINE BUT WHEN GOING OUT THIS FUNTION
THE ACCESS APPLICATION START USING 100% CPU AND HANGS

End Function


Public Function Execute_Procedu re(iProcedure As String, iArgs As
String, iIndicator As Boolean) As Boolean
Dim t1, t2
t1 = Timer

DoCmd.Echo False, "Executing procedure " & iProcedure & " " &
iArgs
Dim oCn As ADODB.Connectio n
Set oCn = New ADODB.Connectio n

oCn.ConnectionS tring = gCn
oCn.Open
oCn.CommandTime out = 0

Dim oCmd As ADODB.Command
Set oCmd = New ADODB.Command

oCmd.CommandTim eout = 0
oCmd.CommandTyp e = adCmdStoredProc

oCmd.CommandTex t = iProcedure & iArgs

oCmd.ActiveConn ection = oCn

oCmd.Execute , , adExecuteNoReco rds

oCn.Close

t2 = Timer

DoCmd.Echo False, iProcedure & " executed in " & CInt((t2 - t1)) &
" seconds"

Set oCmd = Nothing
Set oCn = Nothing

Execute_Procedu re = True

End Function


Nov 13 '05 #2

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

Similar topics

0
2255
by: rvdw | last post by:
Hi All, I've a serious problem with executing stored procedures (SQL2000) from an Access db (version 97). After executing a stored procedure , msaccess hangs. The whole call to the procedure is running fine, but immediatly after this msaccess hangs, when the focus goes back to the calling form ? Has anyone any idea what i can test or look at. Thanks a lot !!!!!!
3
22128
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my application server can talk to the database. I've determined the failure occurs when the the following statement is executed: cstmt.execute(); (due to the failure of println statements placed afterwards). I get the following error after trying to...
7
6195
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to make it better soon. Unfortunately, there is never a non-crucial time in which we can do an upgrade, so we are stuck for now. Point 1: There are multiple tables: students, courses, cross-reference
1
361
by: Neil | last post by:
Hello, I have a SQL Server 2000 database with an Access 97 front end. I want to run stored procedures, (not nessessarily ones which return records either - action type queries for adding new records etc), from access and retreive some result from the procedure which would be used programatically in VBA so that users don't get nasty looking ODBC errors. Could anyone suggest what I need to do? I'm aware I could use a pass through query to...
1
12150
by: Ville Huovinen | last post by:
Platform: Windows 2003 Server (MS SQL Server 2003 SP3) Language: C# Problem: My stored procedures times out randomly, some proces works fine when using them from C#, and some generate SqlException which states that the server has timed out. The problem isn't in server, neither in stored procedures because they work fine in Sql Server's enterprise manager, but when calling from code they are slow and take about 60 seconds before...
1
1465
by: A1 Ronen | last post by:
Hi all I got problem regarding executing all stored procedure through common procedures where we have different parameter with different names, type and data type The Function is as follows Where strProcString is procedure name and strParamString is all parameters concatenated by @
9
15407
by: Leedrick | last post by:
Hi, In the past I have been dealing mainly with sql server, and recently been given the task of supporting software that uses db2 on as400. Simple tasks such as executing a stored procedure from a query window have proven more troublesome than I expected. The procedure I'm trying to call has an output argument. I can't seem to declare a variable to pass outside of a procedure or function, and
2
1472
by: staeri | last post by:
When I execute a stored procedure with the following code it takes forever and result in a timeout or a hang: Sub TransformData() Dim myConnection As New SqlConnection(ConnectionString) Dim myCommand As New SqlCommand("spImport_amount_transform", myConnection) myCommand.CommandType = CommandType.StoredProcedure myCommand.CommandTimeout = 3600
2
7466
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 add EDI capabilities to an accounting package, but the assumption was made that a full version of...
0
8399
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, 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...
0
8312
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,...
0
8827
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8504
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6169
isladogs
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...
0
5632
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
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...
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.