|
Sir, thank you for ur reply.
Suppose in the database we are having 1 to 10 numbers in the serial number column & date is 24-9-06. If we run the VB application on next day, the date will be 25-9-06. So then the Serial number should start freshly from 1,2,3,4,...like wise. the existing records should end on the day itself. This is my problem. Please give me Code to this concept. I would be thankful to you.
chandu
|
|
|
|
|
Ah - I see.
OK, well, if the numbers are just a sequence of 1,2,3,4 for each date, you want to write a stored proc which does this. It will check for the highest number in the table where the date is today, and then store a new number and return it, the number is one higher.
If you have a table called Serials with two entries, serial as an int and date as a datetime, this will work:
create proc InsertSerial @serial int out
as
begin
select @serial = count(*) from Serials where DATEPART(day, date) = DATEPART(day, GETDATE())
and DATEPART(month, date) = DATEPART(month, GETDATE())
and DATEPART(year, date) = DATEPART(year, GETDATE())
set @serial = @serial + 1
insert into Serials (Serial, Date) values (@serial, GETDATE())
end
I'm not sure if there's another way to compare the date without the time, but I tested this and it works fine.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you sir, for your Immediate reply.
I think the procedure should be created in Oracle. am I correct. But I am using MS-Access 2000. Or shall we write this procedure in VB-6. Please reply.
chandu
|
|
|
|
|
Actually, that was SQL Server 2000. I thought Access supported stored procs nowadays ? You may need to change a few things ,but the general idea should still work.
No, I'm not advocating that you handle this in your VB code, although you could. It just makes more sense to me to do it in the DB.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm developing a program where I have to count a number of print time of a report that's really printing out from a printer. Then I ask for a coding that will update the number of printing to a database(including other value if it have to update) after a user press "ok" from a print dialog.
Thank you,
Little Ducky
|
|
|
|
|
Well, you want to store a number in a database. Do you already have a database ? If not, do you need one for just this task, or will an XML file do ?
Whatever the answer to these questions, the questions that typically get answered here are the ones that show signs of the person asking having been willing to do their own work. At this point, you seem to be asking for someone to write all the code for you ( despite not having provided enough info for anyone to do this ), when what you're asking seems straightforward to me, and only a google away.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I wrote script to do a force shutdown,reboot,loggof and restart. I was wondering if someone can help with a way how to write some code how to add these choice to a imput box with option buttons and make the reboot the default button.
Thanks in advance
|
|
|
|
|
You can't change the InputBox to support radio buttons, or anything else for that matter. You can either create your own COM-based form in another lanugage or use Internet Explorer as your presentation interface and create a webpage-based form to support more complex input methods, just like any web page with a FORM tag in it.
You'll have to create an HTML file that displays your form, then use something like this to show it:
Set myIE = CreateObject("InternetExplorer.Application")
myIE.Navigate "fully qualified path to myForm.html"
myIE.ToolBar = False
myIE.StatusBar = False
myIE.Resizable = False
Do
Loop While myIE.Busy
myIE.Width = 600
myIE.Height = 800
myIE.Left = 50
myIE.Top = 20
myIE.Visible = True
The InternetExplorer.Application object has a Document property that can be used to get at the various tag contents and fields in your HTML page. The documentation on it is here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all
I have question
I have windows application with one form1.vb and class classA.vb ...>
Public Class ClassA
Inherits Form1
Public NameTextBox1 As String
Public Sub New()
NameTextBox1 = "Enter Your Name"
TextBox1.Text = NameTextBox1
End Sub
......
End Class
----------------------
And in form1 I dropedd TextBox1
so I want when I make object from classA
Textbox1 .text changed to "Enter Your Name"
*I have tried to make object in form load and nothing changed
any body know th problem
*I hope I explain my problem clearly
*this sample of my prob
thanks---
AMR-CIS
|
|
|
|
|
amr_CIS wrote: so I want when I make object from classA
Textbox1 .text changed to "Enter Your Name"
It does, but if you don't show the form you won't see it.
---
b { font-weight: normal; }
|
|
|
|
|
how can I solve this problem????
AMR-CIS
|
|
|
|
|
Dim myNewForm As New ClassA
myNewForm.Show()
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Did u test it??
its open new form
I want it in the same from
'''I want solution to this problem plz
'''''I tried in Form1_Load
Dim obj As New ClassA
obj.Refresh() '' didnot work
obj.Update() ''' didnt work
AMR-CIS
|
|
|
|
|
Of course it opens a new form. You have created a new form, and if you want to see anything that you do to that form, you have to open it.
If you don't want to open another form, you shouldn't create another form.
---
b { font-weight: normal; }
|
|
|
|
|
You didn't specify that this is what you wanted to do. I has to guess at it based on what you posted and your code sample.
If you want this to happen in the already open form, why did you even both to create a new class and inherit the original form???
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If you have a form called Form1, and you create an instance of that form, then the textbox you can see is the textbox that belongs to THAT instance. Creating a new instance will not give you any sort of access to the prior instance. Instead, you need to use delegates or references to the form to create communication between classes.
I see no reason to ever derive a class from a form, unless you're looking to inherit some UI from the base form and add additional UI in the new class. You're trying to access a textbox in the base class, and also making a copy of that string into a variable ( which is redundant ). I dunno what you hope to do with this, but creating an instance of classA will not give you access to the visible instance of Form1, any more than creating a new instance of Form1 would.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
You've got a full 101-key keyboard in front of you, use it!
SMS-speak is frowned upon here, and on just about every other programming forum.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If you try typing full English words into google, you'll have more luck finding what you're after.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
In VB6 , how to save a picture from a certain picture box, that it's values were created using the PSet function .. not loaded directly through loadpicture() ?
Luay Al-wesi
|
|
|
|
|
W this simple code
u can save ur images
SavePicture Picture1.Picture, "c:\X.bmp"
repalce Picture1 w image disp
replace "C:\X.bmp" w ur fav path
Khalefa_13@yahoo.com
|
|
|
|
|
I tried that before .. it won't work unless the picture is already loaded from a file ... the picture I want to save is made used pset function ... I didn't work this way
Luay Al-wesi
|
|
|
|
|
I got it ... you have to write savepicture pic1.image , filepath
Luay Al-wesi
|
|
|
|
|
Suppose i have a String (abcdefghi.kkkkaaaa.ghghgh.kkklklk/kgkhg). Now i want to find how many times does dot occurs in the string.PLease help me out
Mohinder Singh
|
|
|
|