473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Recover SQL string

Hi

I would like to know if there is an an easy way to recover the entire SQL string sent to the SQL server built using ADO adparam methods.
I need to recover and assign to a variable the entire SQL string executed by objCmd.Execute below

Thanks

example

'Declare database objects
Dim objConn As New ADODB.Connection
Dim objCmd As New ADODB.Command
Dim objErr As ADODB.Error

'Establish a database connection using SQL server Authentication
objConn.Open "DSN=DSNname;UID=sa;PWD=password;DATABASE=DBna me"

'Check the state of the connection to ensure we are connected
If objConn.State = adStateOpen Then

'Set the Command object properties
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "spExportGroup"
objCmd.CommandType = adCmdStoredProc

'Set the Command object parameters
objCmd.Parameters.Append _
objCmd.CreateParameter("LastName", adVarChar, adParamInput, 80, LastName)

objCmd.Parameters.Append _
objCmd.CreateParameter("FirstName", adVarChar, adParamInput, 80, FirstName)

objCmd.Parameters.Append _
objCmd.CreateParameter("CompanyName", adVarChar, adParamInput, 80, CompanyName)

objCmd.Parameters.Append _
objCmd.CreateParameter("GuestType", adVarChar, adParamInput, 20, GuestType)

objCmd.Parameters.Append _
objCmd.CreateParameter("EmailID", adVarChar, adParamInput, 250, EmailID)

objCmd.Parameters.Append _
objCmd.CreateParameter("SeminarID", adVarChar, adParamInput, 20, SeminarID)

objCmd.Parameters.Append _
objCmd.CreateParameter("PropertyCode", adVarChar, adParamInput, 20, PropertyCode)

'Execute the Command object
objCmd.Execute
Feb 17 '08 #1
0 878

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: WKC | last post by:
Recently, one of our database's mdf and ldf was corrupted. We were able to bring back the database with the capability of importing and querying the data. However, the data is not the full list. ...
1
by: Moti | last post by:
I have SQL server 2000 which recently crashed. I try to recover it and found out that the Master database is corrupt. I never backup my server using inline sql backup nor any third party backup...
5
by: Alexander Malkis | last post by:
How to recover from failing cin.get(str,n,'\n')? The user pressed "Enter" on cin.get(...).I would like to let him try once more but the system doesn't stop on the next cin.get. Code: ...
4
by: chuy | last post by:
Is there a way to recover a lost password in Mysql 4.1. I have seen many articles and howto's on how to kill the Mysql process and then restart using skip grant tables option. I am not trying to...
5
by: Prem K Mehrotra | last post by:
I come from Oracle background. In Oracle, when one wants to do a point in time recovery, one can specify recover database until timestmap. Oracle's database maps to a db2 subsystem, i.e., in...
3
by: apple | last post by:
UDB v8 fp 6a on AIX 5.1.0.0 Below is a manual incremental recover from compressed backup datasets. With external compress backup datasets, can it be coded to do an automatic incremental recover?...
5
by: Grant | last post by:
Hi Is there a way to recover deleted records from a table. A mass deletion has occurred and Access has been closed since it happened Louis
2
by: Maellic | last post by:
Hi, I'm currently updating a website written with ASP.NET. The original programmer is overseas, there is no documentation, and files are all over the place. Here is a code snippet from one of...
0
by: mike_dba | last post by:
I have been testing the db2 recover command on a DB2 V8.2 Linux database. The database contains a single partition. I am not archiving logs but retaining them on disk. the backup image is to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.