|
Dim DS As New DataSet
Dim query as string = "SELECT * from DAP"
Dim OLEConn = New OleDb.OleDbConnection("connection string goes here")
Dim adapter As New OleDb.OleDbDataAdapter
adapter.SelectCommand = New OleDb.OleDbCommand(query, OLEConn)
adapter.Fill(DS)
THIS IS THE POINT OF TROUBLE...
???? DS.Tables().Clear() ???? 'not this
???? DS.Tables().Remove() ???? 'not this
I want to delete the table "DAP" and I know the code above is not the correct way to just connect to a database, select a table, then delete the table. Does anyone have a snipet of code that 1. connect to a db. 2. selects a table. 3. deletes the selected table?
Thanks.
|
|
|
|
|
HRusaw wrote:
Dim DS As New DataSet
Dim query as string = "SELECT * from DAP"
Dim OLEConn = New OleDb.OleDbConnection("connection string goes here")
Dim adapter As New OleDb.OleDbDataAdapter
adapter.SelectCommand = New OleDb.OleDbCommand(query, OLEConn)
adapter.Fill(DS)
Dim query as string = "TRUNCATE TABLE DAP"<br />
'or if you need to log the action - but truncate will be faster<br />
'Dim query as String = "DELETE FROM DAP"<br />
Dim OLEConn = New OleDb.OleDbConnection("connection string goes here")<br />
dim cmd as OleDbCommand = New OleDb.OleDbCommand(query, OLEConn) <br />
cmd.ExecuteNonQuery
|
|
|
|
|
Scott and Sumit21,
Thank you for your help. The snippet's you two submitted helped a lot and were exactly what I was looking for.
Thanks Again,
Helen
|
|
|
|
|
in SQL (structured query language) there is a command that deletes the whole table: DROP Table (tablename) - I'm not sure the exact syntax of the VB.NET version of that command, but that should give you a place to start. Also you might check out the MSN group at http://groups.msn.com/VisualBasic/ (go to "Message Board" in the left frame and they have "Databases" and "VB.NET" message boards). You have to get a (free) msn passport in order to join the group, and then get approved by a manager or assistant manager (I am an assistant manager, so once you get the Passport, e-mail me @ rhenerlau@hotmail.com and I will approve you.)
Hope this helps!
Richard Henerlau
|
|
|
|
|
use oledbcommand
//con is oledbconnection
dim com as oledbcommand=new oledbcommand("drop table tablename",con)
con.open
com.executenonquery();
con.close
hope this will work
|
|
|
|
|
Scott and Sumit21,
Thank you for your help. The snippet's you two submitted helped a lot and were exactly what I was looking for.
Thanks Again,
Helen
|
|
|
|
|
Scott and Sumit21,
Thank you for your help. The snippet's you two submitted helped a lot and were exactly what I was looking for.
Thanks Again,
Helen
|
|
|
|
|
Hi,
I'm inheriting a base form we have written that mostly handles button arrangements. Every time I disable/enable the derived form it gets moved behind any other windows that are currently open. There is no code in either form that should be causing this behavior. We are not overriding or altering the enabled code in the base form in any way. Has anyone else encountered this problem or know how to fix it?
Thanks,
Joe
|
|
|
|
|
i want to know how to start application just like the msn or yahoo msngr which start whenever the computer starts.
second i want to know where r they placed in the windows xp. if i want to do that through code of vb6 what i have to do.
|
|
|
|
|
They are service applications, which VB6 cannot create. There is a seperate application that communicates with the service app that handles the user interface when someone logs in.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hold on there Gnome boy, you CAN run VB6 apps as services. If you Google "VB6 Services" you'll find tons of examples of this. Such as....... http://www.vbrad.com/pf.asp?p=source/tip_service_vb.htm
Joe
|
|
|
|
|
Hold it there, wiseass. Read the post again and the history of his other posts concerning the very same topic. The link you just gave me, I originally posted as my first or second reply to him!
Now, I said that VB6 could not generate a windows service. This is exactly right! I know perfectly well that you can take a VB app and run it AS a service within a service WRAPPER, but you can't generate a TRUE service app with it. The VB6 compiler will not output the correct service entry point...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how to make a process a service in VB.
i am seeking help in VB to make my application's exe run without being tirggered just like worms.
The payload of my application is Just MessageBox stating "Welcome From Usman".So there are two main issues ,
1)How to execute exe without tirggering it
2)Where to place and how so that every time windows starts(not user logs in) , it executes it self and show the message box.
I hope that you will help me.
Regards
UsmanMir
|
|
|
|
|
so...you're gonna make a virus...
TERRORIST
Never say never
I think i can help you with the first requisite the second one i only know how to do it manually (put the shortcut in the Startup folder... :P)
use the Process class and its Start method:
Dim myProcess As New Process<br />
myProcess.Start("myApp.exe")<br />
(...)
|
|
|
|
|
A windows service has to be installed. VB6 doesn't come with anything to do that. There are, however, 3rd party utilities that do. I already posted a link for you to follow that contains instructions on how to do it.
Next, you have a huge problem that you can't resolve. Since your application is running as a service, it runs under a completely different desktop than the one the user sees. This mean, that unless your service is tagged "Allow interaction with desktop...", the messagebox you put up will never be seen by the user.
Now, having solved that little problem, you have a second problem. You said you want to put up a dialog box while no user is logged in. Not going to happen. Since there is no desktop when a user isn't logged in, there's no way to put up a visible message box.
On top of that, your VB6 app is not a true service. This means that you don't get the notification messages that the user session is being terminated or started, so you can't tell when someone logs on or off.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to select and rename the column name to PROD_ID( to product) and QTY( to total) in vb form and show resulting table in vb form
SALE_ID PROD_ID QTY
1 Tomatoes 30
|
|
|
|
|
I have created a cpp program. I want to run its exe from visual basic.I want to pass some parameters to the main function of cpp program through visual basic program variables.Can anybody tell me how to do it?
Thank u.
SHYAMALA LOKRE
SAMRAT ASHOK TECHNOLOGICAL INSTITUTE ,
VIDISHA.
|
|
|
|
|
Easy. Check into the Process[^] class. The only way your going to pass your VB program variables to the external .EXE is to pass them as command line parameters when you launch the .EXE.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I create one subfolder in outlook calender.I want to Create an apponitment in that folder using VB.NET.How can i do it?I need sample code in VB.NET..
Thank you very much
Ilangovan
|
|
|
|
|
http://www.outlookcode.com/
|
|
|
|
|
how to make application as service.any links
ddd
|
|
|
|
|
Start by opening Visual Studio, click on New Project, open the folder for VB.NET, double click on Windows Service in the project templates pane. From there, read this[^] for a walkthrough on how to create one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a question about programming the DataReport in VB6.
Do I need to use the DataEnvironment to link a database and table to the report or can I create a connection and recordset in code. I'm asking this question because I wish to create a report based on a user's query not a static query.
|
|
|
|
|
is it possible to show an html webpage inside a vb6 textbox...or other control?
thank.....
---- mike
|
|
|
|
|
Not in a TextBox. You'll have to add a WebBrowser control to your form and use that to diplay the page. Just add the Microsoft Web Browser component to your ToolBox and drop one on your form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|