473,804 Members | 3,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recover SQL string

1 New Member
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.Connectio n
Dim objCmd As New ADODB.Command
Dim objErr As ADODB.Error

'Establish a database connection using SQL server Authentication
objConn.Open "DSN=DSNname;UI D=sa;PWD=passwo rd;DATABASE=DBn ame"

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

'Set the Command object properties
Set objCmd.ActiveCo nnection = objConn
objCmd.CommandT ext = "spExportGr oup"
objCmd.CommandT ype = adCmdStoredProc

'Set the Command object parameters
objCmd.Paramete rs.Append _
objCmd.CreatePa rameter("LastNa me", adVarChar, adParamInput, 80, LastName)

objCmd.Paramete rs.Append _
objCmd.CreatePa rameter("FirstN ame", adVarChar, adParamInput, 80, FirstName)

objCmd.Paramete rs.Append _
objCmd.CreatePa rameter("Compan yName", adVarChar, adParamInput, 80, CompanyName)

objCmd.Paramete rs.Append _
objCmd.CreatePa rameter("GuestT ype", adVarChar, adParamInput, 20, GuestType)

objCmd.Paramete rs.Append _
objCmd.CreatePa rameter("EmailI D", adVarChar, adParamInput, 250, EmailID)

objCmd.Paramete rs.Append _
objCmd.CreatePa rameter("Semina rID", adVarChar, adParamInput, 20, SeminarID)

objCmd.Paramete rs.Append _
objCmd.CreatePa rameter("Proper tyCode", adVarChar, adParamInput, 20, PropertyCode)

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

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

Similar topics

1
6672
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. Some of the data are still missing because the tables we want still has sone 'chain mis linkage' error when we did a DBCC checkdb/checktable. DBCC couldn't fix those errors either. We're pretty sure that there are some data still burry under the...
1
3504
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 program that aware to SQL server. But I have full system backup of volume c on tape (using NTBackup), which includes old version of Master database. My questions are: 1. How can I recover this file into SQL server? 2. If so, it is not risky to...
5
2253
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: cin.get(str,n,'\n'); cout<<"haha\n"; char c; /* Now get '\n'. Doesn't work if the first time nothing else was input. Have this line or leave it -it doesn't change the outcome in this case.
4
2698
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 reset the password but rather recover it. Resetting the password to something else would cause a problem some of the underlying programs that rely on MySQL. I don't feel like changing code for every application that is using MySQL in my site. ...
5
3830
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 Oracle database means entire database, i.e.. all tablespaces (including indexes). I see only recover tablespace and recover indexspace (or index) commands in db2. Therefore, one has to specify all the tablespaces and indexspaces and recover them
3
3174
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? The manual incremental recover works just fine, but having trouble getting the automatic incremental recover to work. Thanks for your help # INCREMENTAL BACKUP
5
29019
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
2249
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 the .vb file used by the application (the entire code of the file is at the end of the post): If EmissionsWebBLL.Security.ValidateLogin(txtUserName.Text,
0
1798
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 disk as well. I performed the following in order : 1. OFFLINE BACKUP <time#1> 2. Create table S.T (c1 smallint) 3. Insert several rows into S.T - values 1,2,3,4,5 4. ONLINE BACKUP <time#2> 5. Insert several more rows 6,7,8,9
0
9706
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
9577
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
10325
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9140
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
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
5519
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...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.