|
I had a look at that site & I don't think it's possible as they don't offer any RSS feeds or other web services.
Why don't you subscribe to their email service instead? It'll be way easier.
|
|
|
|
|
I was trying to link my vb6 to the MYSQL but i got this
Error:"user defined type not defined"??
<big>Dim dbb As Database</big> <-- Error<br />
Dim rs As Recordset<br />
Dim strConnect As String<br />
Dim strSQL As String<br />
Dim strResult As String<br />
<br />
'Set connect string.<br />
strConnect = "ODBC;DSN=DSN_SP_TEST;"<br />
<br />
'Open the database<br />
Set dbb = DBEngine.Workspaces(0).OpenDatabase("", False, False, _<br />
strConnect) <br />
'Create the stored procedure. It really does not do much.<br />
'It simply sets the variables and returns<br />
strSQL = "/****** Object: Stored Procedure dbo.sp_Vendor */"<br />
strSQL = strSQL & vbCrLf & "CREATE PROCEDURE storebo.sp_vendor"<br />
strSQL = strSQL & vbCrLf & "/* Declare Parameters */"<br />
<br />
strSQL = strSQL & vbCrLf & "@param1 varchar(20) ,@param2 varchar(20) ,"<br />
strSQL = strSQL & vbCrLf & "@param3 smalldatetime ,@param4 smalldatetime"<br />
strSQL = strSQL & vbCrLf & "as"<br />
strSQL = strSQL & vbCrLf & "begin"<br />
strSQL = strSQL & vbCrLf & "SELECT dep.[name],dep.deptcode,dep.deptdesc,dep.depttotal, (dep.DeptTotal / (SELECT sum(dep.depttotal)"<br />
strSQL = strSQL & vbCrLf & "FROM (SELECT v.[name],d.deptcode,d.deptdesc, SUM(ti.totalsales) AS DeptTotal"<br />
strSQL = strSQL & vbCrLf & "FROM item i ,vendor v,tot_item ti INNER JOIN dept d ON (ti.deptcode=d.deptcode) where ti.itemcode=i.itemcode and v.vendorid=i.vendorid and v.[name]>=@param1 and v.[name]<=@param2 and ti.bizdate>=@param3 and ti.bizdate<=@param4"<br />
strSQL = strSQL & vbCrLf & "group by v.[name],d.deptcode,d.deptdesc) AS dep )) * 100 AS PercentOfSales"<br />
strSQL = strSQL & vbCrLf & "FROM (SELECT v.[name],d.deptcode,d.deptdesc, SUM(ti.totalsales) AS DeptTotal"<br />
strSQL = strSQL & vbCrLf & "FROM item i ,vendor v,tot_item ti INNER JOIN dept d ON (ti.deptcode=d.deptcode) where ti.itemcode=i.itemcode and v.vendorid=i.vendorid and v.[name]>=@param1 and v.[name]<=@param2 and ti.bizdate>=@param3 and ti.bizdate<=@param4"<br />
strSQL = strSQL & vbCrLf & "group by v.[name],d.deptcode,d.deptdesc) AS dep"<br />
strSQL = strSQL & vbCrLf & "ORDER BY dep.[name] ASC"<br />
End<br />
MsgBox strSQL<br />
db.Execute strSQL, dbSQLPassThrough<br />
-- modified at 22:16 Tuesday 17th October, 2006
|
|
|
|
|
I don't see a UDT in the code you have posted ? It looks to me like you almost got to the part that matters and stopped.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
User Defined Type.
A custom type that you create, specifying it's structure, members, and member types.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
what should i need to create for database?
|
|
|
|
|
The compiler is bitching because the type "Database" doesn't exist, or at least you haven't supplied enough information to tell the compiler where to find the Database type definition. Is this an ADODB Database object? If so, you'll probably have to do something like this:
Dim dbb As ADODB.Database
DO NOT COPY AND PASTE THIS CODE INTO YOUR APP!! I have no idea if it's going to work and can't even tell you if the Database object you're looking for is even in the ADODB namespace.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i have create procedure in mySQL to run my program, but is troublesome to done is 1 by 1 for the customer in their database. So i was thinking to have a button when they click it, then in MYSQL will perform the SQL that i create.
MY sql r to Create procedure.
I'm using vb6
|
|
|
|
|
I believe there is a site dedicated to VB/MySQL issues. It's called VBMySQL.com or something.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi everyone,
I want to run a program and set it's privilleges to interactive(SYSTEM).
if we do the DOS command "at.exe 10:00 /interactive someprogram.exe"(where 10:00 is the time when the program will be executed), we can see it running as the SYSTEM user at the windows taskmanager's processes tab.
there's a way to do that using windows api, but i cant find anything about that. i would be very glad if someone could give me a few pointers on how to do that in VB6.
thanks in advance
|
|
|
|
|
I'm using VB.NET 2005.
I have a list of filenames in a ListBox.
What I would like to do is to click on a filename (an item in my ListBox) and drop the file, not the filename.
An example would be to select a filename in the ListBox, and drag and drop that file to Outlook email I want to send. When I try what I know, all I can get dropped is the filename as text.
Windows Explorer lets us drag and drop a file into Outlook as an attachment.
Any insights would be highly appreciated.
Thanks
Carl@CarteBlanc.com
|
|
|
|
|
'Here is the Drag and Drop Code from above - VB.NET 2005.
'
'Problem 1:
'When I drag and drop a file name from ListBox1 to PictureBox1, it works.
'When I drag and drop a filename from ListBox1 to Outlook Email for use
'as an attachment, I get the filename text inserted.
'
'Problem 2:
'When I try and drag and drop from the PictureBox1 to Outlook or
'the Paint program, I get nothing.
'
'Any Ideas on how to fix this???????
'--------------------------------------------------------------------
Public Class Form1
'The Problem lies in the SelectedItem property. Actually if you do the mouse
'down the item is not already selected. You have to use the SelectedIndex
'and get then the the according item. Please find the code below which is
'working.
Private Sub ListBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDown
If e.Button = MouseButtons.Left Then
If ListBox1.SelectedIndex > -1 Then
ListBox1.DoDragDrop(ListBox1.Items.Item(ListBox1.SelectedIndex).ToString, DragDropEffects.Copy)
End If
End If
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
Dim o As New DataObject
o.SetData(DataFormats.Bitmap, PictureBox1.Image)
PictureBox1.DoDragDrop(o.GetData(DataFormats.Bitmap, True), DragDropEffects.Copy)
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Debug.WriteLine("SelectedIndexChanged - " & ListBox1.SelectedItem.ToString)
End Sub
Private Sub PictureBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PictureBox1.DragEnter
If e.Data.GetDataPresent(GetType(System.String)) = True Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.Link
End If
End Sub
Private Sub PictureBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PictureBox1.DragDrop
If Not PictureBox1.Image Is Nothing Then
PictureBox1.Image.Dispose()
PictureBox1.Image = Nothing
End If
PictureBox1.Image = Image.FromFile(CStr(e.Data.GetData(GetType(System.String))))
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub FillListBox()
'Fill list box with list of bitmap files in the Windows directory
ListBox1.DataSource = System.IO.Directory.GetFiles("C:\Windows\", "*.bmp")
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
FillListBox()
PictureBox1.AllowDrop = True
End Sub
End Class
|
|
|
|
|
I have an application that connects to a large Access database for its data. Strange thing: The program does unpredictable things (does not update the Access database or locks up) when accessing the database for the first time. This only happens the first time it is run right after it is installed. Any accessing to the database after the first time works without any problems. This can be reproduced on more than one computer. It never happens when running from the development environment. An ideas why this is happening?
|
|
|
|
|
can you give the code sample used for updating database and not updating first time.
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|
|
Hello -
I am trying to make all textboxes, comboboxes, and datetimepickers on my form ReadOnly.
But only if certain criteria is True therefore, I need to do this at runtime.
Also, there are lots of controls on my form that need to be switched so I would love to be able to
make this switch to ReadOnly without having to explicitly nameing each contol
for example I don't want to have to write the following code for every control :
textbox1.readonly = TRUE
I would like to be able to use the control collection if possible.
For x = 0 To (Me.Controls.Count - 1)
Select Case Me.Controls(x).GetType.Name
Case "Textbox"
. . .
Case "Button"
. . .
Case "Label"
. . .
Case Else
Me.Controls(x).Enabled = False
End Select
Next x
Does anyone have any suggestions ?
Thank you for all replys
Shawn Owens
|
|
|
|
|
yes, I don't see any reason for this not to work, although I would use foreach to iterate over them. Does this code not work for you ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The main problem I have using this code is
accessing a controls ReadOnly property.
Intelisense does not recognize:
me.controls(x).name.readonly = True
it would be nice if there were an allTextboxes property for the form
or something like that.
|
|
|
|
|
Perhaps not all controls have a readonly property ? See if there's a base class or interface you can use to access this property, if not, you need to cast the objects to get to it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How would I go about casting the objects ?
Do I use ctype() ? and do I cast them to type textbox (or
whatever control is appropriate) or type obj ?
Thank you so much
Shawn
|
|
|
|
|
Yes, if it's a textbox, cast it to a textbox. I guess ctype is what you need, not sure.
Or, look if an interface is used to impliment read only in controls, then you can cast all to that.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You'd use CType to cast the control instance to the type of control your working with. The "gotcha" in doing something like this is that controls can be parents of other controls, such as when a TextBox sits in a Panel, the TextBox won't show up in the Form's Controls collection. You'd have to use recursion to go through all the child controls of each control to find everything you need.
If you have a group of controls of different types that nbeed to be set as ReadOnyl, drop them all into a Panel or GroupBox control. That way, all you'd have to do is something like this:
Private Sub SetControlsReadOnlyState(ByRef rootContainer As Control, ByVal state As Boolean)
For Each c As Control In rootContainer.Controls
If TypeOf c Is TextBox Then
Dim tb As TextBox = CType(c, TextBox)
tb.ReadOnly = state
End If
If c.HasChildren Then
SetControlsReadOnlyState(c, state)
End If
Next
End Sub
Then to call this and set all the TextBox controls inside Panel1 to ReadOnly, all you'd have to do is:
SetControlsReadOnlyState(Panel1, True)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I love recursion !
This will do just fine,
Thanks Christian and Dave !
|
|
|
|
|
just a few things that i need to know,
How to create a MsgBox that allows me to load another form when i click yes and when i click no it closes program?
Also how do i do a global variable becauase i cant reset my 'rlmemory' sum back to 0 from another form or can I?
thats all
thanks in advance
|
|
|
|
|
Ultima Reborn wrote: How to create a MsgBox that allows me to load another form when i click yes and when i click no it closes program?
You need to not use MSgBox if you're using VB.NET. Use MessageBox.Show, which has a parameter to specify what buttons you show, and then you can check the DialogResult that is returned to decide which action to take.
Ultima Reborn wrote: Also how do i do a global variable becauase i cant reset my 'rlmemory' sum back to 0 from another form or can I?
You can't. Global variables are generally a bad idea. You can create what you want with a public shared variable, but I'd advise against it.
Ultima Reborn wrote: becauase i cant reset my 'rlmemory' sum back to 0 from another form or can I?
I have no idea what your rlmemory sum is, but I assume it's an int or something. You can use delegates for inter form communication. You can also make it shared, if there's only one within the app. Also, if your form that contains the value is a child of the form that wants to change it, you can do it directly.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You can use MsgBox. Try this:
<br />
MsgBox("Text here", MsgBoxStyle.YesNo)<br />
If DialogResult = Windows.Forms.DialogResult.Yes Then<br />
FormName.Show()<br />
Else<br />
Me.Close()<br />
End If<br />
|
|
|
|