473,395 Members | 1,526 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,395 software developers and data experts.

Running SQL statements with VB 6.0

18
I would like to customize running my SQL statement. At this moment, I am using->

DoCmd.RunSQL strSQL

This statement will deletes from one of my tables, but instead of getting the standard message box:


"You are about to delete 1 row(s).

Once you click Yes, you can’t use the undo command to reverse the changes. Are you sure you want to delete the selected row?

"

I would like to customize my own, but I am not sure how to do it. Any suggestions would be greatly appreciated.
Oct 9 '07 #1
4 4447
Killer42
8,435 Expert 8TB
Can't you just do a MsgBox before issuing the SQL command?
Oct 10 '07 #2
jesse07
18
I can do a message box but the same prompt comes up when I execute the delete from the table

**************************************************
You are about to delete 1 row(s).

Once you click Yes, you can’t use the undo command to reverse the changes. Are you sure you want to delete the selected row?

************************************************** *

I do not want this prompt to come up, and I believe it is a default with the DoCmd.RunSql. I
Oct 10 '07 #3
Killer42
8,435 Expert 8TB
Ok, I think you're telling us fibs here. This isn't VB6, is it? It's VBA, the macro language, in MS Access - right?
Oct 10 '07 #4
Dan2kx
365 100+
If you are in Access you can use

DoCmd.SetWarnings True/False

And once you have done that you can (well before actually) you can set up a msgbox response.

I would do it like this

[on click event](or whatever)
Expand|Select|Wrap|Line Numbers
  1. dim response as Integer
  2. dim strSQL as string
  3. strSQL = ("query code") 
  4. response = msgbox("blah blah",vbokcancel)
  5. if response = vbok then 
  6.   docmd.setwarnings false
  7.   docmd.runSQL strSQL
  8.   docmd.setwarnings true
  9. else
  10.   msgbox "Procedure canceled by user"
  11. end if
  12. end sub
Just a suggestion
Oct 11 '07 #5

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

Similar topics

1
by: John Sway | last post by:
I'm writing a web-based "Query analyser" tool for our company intranet. It allows a user to type any SQL statement in a form, and execute it over the Web. The SQL can be a query that returns...
1
by: Ed | last post by:
Don't know where else to ask this question...AFS people tell me they can't answer JavaScript questions...it's a little of both with vbscript mixed in. I have a series of select statements such...
5
by: fwells11 | last post by:
Hi there. As you will see from my questions, I am an SQL newb. I dabble but never get to spend enough time to get proficient so base any feeedback on that basis please. This is all theoretical...
11
by: Gregor Kovaè | last post by:
Hi! I have an SQL script with bunch of CREATE TABLES, ALTER TABLES, ... I'd like it to run transactially. I have found that id I run a ALTER STATEMENT inside a transaction and then roll it back...
1
by: Aaron West | last post by:
Try this script to see what queries are taking over a second. To get some real output, you need a long-running query. Here's one (estimated to take over an hour): PRINT GETDATE() select...
12
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
41
by: Gary Wessle | last post by:
Hi often I need to read numbers and only keep the highest or lowest. so I do something like int uLimit = 0; int lLimit = 999999999999; //hoping the compiler will not complain uLimit =...
9
by: JJM0926 | last post by:
I'm trying to create a running totals query in access 97. I have followed the directions on how to do it from Microsofts website article id 138911. I took their code they had and replaced it with...
4
by: dougans | last post by:
Hey there people, Need help on this one if you can spare me a second!!! No idea why, been trying for 2 hours to fix this now and I feel like a complete loser haha. Anyone have any idea why...
2
by: Michel Esber | last post by:
Hello DB2 LUW v8 FP15. My Database STMTHEAP parameter is 4096 * 4k pages, so there is plenty of space. IF: a) I use Java's and JCC, I am able to run long statements ( 65K ). b) I use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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...

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.