|
Well, for starters, are you sure the logindate and time of login you're passing in are correct ? I'd be inclined to suggest you can simplify this to where Emp_ID = ? and time_logout is null, or something to use the most recent login date. Also, the column names should not be in quotes.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks can work d...UPDATE LOGIN_OUT
SET Time_logout = ?
WHERE ([Time_login] = ?) AND ([Emp_ID]= ?) AND ([Logindate] = ?)
i do with this
|
|
|
|
|
Glad to help. For the record, your questions are not nasty. We have a lot of people asking these sort of questions when they are working, and THAT is nasty. Perhaps try saying in future that you're a student in your posts, I think you are getting stuck in the fallout from a negative feeling towards people who have taken jobs they are not ready for. If you're a student, any question is valid, and that's what we're here for.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i think i written here before that just start my college life..and this is 1st assigment that i got ..it call selling and buying system...many thing i learn in college but there is more thing i did't not learn..this time is problem is how do i do calculation in vb and database..
|
|
|
|
|
hi, i try to make the database to be updated with .addnew,.update function in the array below. but there was an error.as the below coding, i haven't make any changes to makesure the database be updated as the new data entered.help me. . for information. this is about interconnected within two forms, that is main form, and addnew projects form.
'this is a part of the main form to display the projects
Public Sub Display_The_Projects()
Dim intCounter As Integer
Dim intCounter_2 As Integer
Dim intCounter_Outside As Integer
Dim Date_In As Date
Static blnNot_First_Time As Boolean
'blnNot_First_Time = False
' Initial Array Assignments
If blnNot_First_Time = False Then
datTo_Do.Recordset.MoveFirst
intCounter = 1
intCounter_2 = datTo_Do.Recordset!Tab_Number
Do Until datTo_Do.Recordset.EOF
If intCounter_2 <> datTo_Do.Recordset!Tab_Number Then
intCounter = 1
intCounter_2 = datTo_Do.Recordset!Tab_Number
End If
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 1) =
datTo_Do.Recordset!comment
If datTo_Do.Recordset!Code = "A" Then
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) = "Active"
ElseIf datTo_Do.Recordset!Code = "R" Then
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) = "Reactive"
End If
gdtmTo_Do_Dates(datTo_Do.Recordset!Tab_Number + 1, intCounter, 1) =
datTo_Do.Recordset!Date_Entered
gdtmTo_Do_Dates(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) =
datTo_Do.Recordset!Date_Due
intCounter = intCounter + 1
datTo_Do.Recordset.MoveNext
blnNot_First_Time = True
Loop
End If
Date_In = #9/23/1999#
For intCounter_Outside = 1 To 6
picTo_Do(intCounter_Outside).Cls ' Clear the picture box
For intCounter = 1 To 12 ' Set the color and print the project
If gstrTo_Do_Array(intCounter_Outside, intCounter, 1) > "" Then
If gdtmTo_Do_Dates(intCounter_Outside, intCounter, 2) < Date_In Then
picTo_Do(intCounter_Outside).ForeColor = vbRed
ElseIf gstrTo_Do_Array(intCounter_Outside, intCounter, 2) = "Active" Then
picTo_Do(intCounter_Outside).ForeColor = vbBlack
Else
picTo_Do(intCounter_Outside).ForeColor = vbMagenta
End If
' Position the cursor then Print the project
picTo_Do(intCounter_Outside).CurrentX = 50
picTo_Do(intCounter_Outside).CurrentY = (intCounter - 1) * 300 + 40
picTo_Do(intCounter_Outside).Print gstrTo_Do_Array(intCounter_Outside, intCounter, 1)
End If
Next intCounter
Next intCounter_Outside
End Sub
'this the the addnew project form
Private Sub cmdCancel_button_Click()
Unload frmAdd_To_Do
End Sub
Private Sub cmdOk_Button_Click()
Dim intCounter As Integer
Dim intPriority As Integer
' Determine the Priority
For intCounter = 1 To 5
If optTo_Do_Priorities(intCounter).Value = True Then
intPriority = intCounter
End If
Next intCounter
' Find the first empty spot in the array
intCounter = 1
Do While gstrTo_Do_Array(intPriority, intCounter, 1) <> "" And intCounter < 12
intCounter = intCounter + 1
Loop
' Put data in the array
gstrTo_Do_Array(intPriority, intCounter, 1) = txtTo_Do_Description
gstrTo_Do_Array(intPriority, intCounter, 2) = "Active"
gdtmTo_Do_Dates(intPriority, intCounter, 1) = Date
gdtmTo_Do_Dates(intPriority, intCounter, 2) = txtDue_Date
Unload frmAdd_To_Do
End Sub
*the problem is im in problem to make it as .addnew, .update, to make sure any added projects is updated in database.plz give me some idea.
modified on Saturday, April 12, 2008 4:12 AM
|
|
|
|
|
I don't see any database code, but if the problem is getting the main form in sync with what happens in a child form, use delegates to call methods on your main form when things happen on the child form.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yes, i havent add any database code, since that is my problem. because i got a problem to add database code in array in a child form.i hope this will be more clear.tq so much
when i put .addnew, .update function to make sure my database is updated when the new info is added
' Put data in the array
'this is the first coding before database coding is added
gstrTo_Do_Array(intPriority, intCounter, 1) = txtTo_Do_Description
gstrTo_Do_Array(intPriority, intCounter, 2) = "Active"
gdtmTo_Do_Dates(intPriority, intCounter, 1) = Date
gdtmTo_Do_Dates(intPriority, intCounter, 2) = txtDue_Date
'this is the new coding with the database code
'but it doesnt work
gstrTo_Do_Array(intPriority, intCounter, 1) = txtTo_Do_Description
datTo_Do.Recordset.Addnew
datTo_Do.Recordset.Field("Comment")=txtTo_Do_Description
datTo_Do.Recordset.Update
gstrTo_Do_Array(intPriority, intCounter, 2) = "Active"
datTo_Do.Recordset.Addnew
datTo_Do.Recordset.Field("Code")="Active"
datTo_Do.Recordset.Update
gdtmTo_Do_Dates(intPriority, intCounter, 1) = Date
gdtmTo_Do_Dates(intPriority, intCounter, 2) = txtDue_Date
datTo_Do.Recordset.Addnew
datTo_Do.Recordset.Field("Date_Due")=txtDue_Date
datTo_Do.Recordset.Update
modified on Saturday, April 12, 2008 10:20 AM
|
|
|
|
|
inderabangsawan wrote: datTo_Do.Recordset.Addnew
datTo_Do.Recordset.Field("Comment")=txtTo_Do_Description
You called AddNew , but then completely ignored the record object returned from it. You're not making any changes to the new record at all, you've just added a blank record to the dataset.
|
|
|
|
|
hi all
i have developed an application in vb.net with mssql express. now i wants to handle my users, when a user wants to handle logout or logoff and switch over to new login, i mean to say before logout or logoff i want ot close all opened forms in the curret session.
pl help me to handle it.
thanks
rmshah
Developer
|
|
|
|
|
How you do this depends on the design of the application.
Either, your application should be tracking all of it's open forms, probably in a collection, so that it can close them all when needed, or if there is a chain of forms open, the user should be forced to close or cancel all open forms in order to get back to the main form.
Putting the logout option deep inside your app is not a correct design choice.
|
|
|
|
|
hai friends
i have a problem in access Ms-access database table..
for the database , i set a password...
and i written the following code to access it ....
Try
Dim con As New OleDbConnection("Provider=Microsoft.JET.OleDb.4.0;User Id=administrator;Password=xyz;Data Source=D:/DataBase/Master.mdb")
Dim da As New OleDbDataAdapter("select * from login", con)
Dim ds As New DataSet
da.Fill(ds, "login")
DataGridView1.DataSource = ds
Catch ex As Exception
MessageBox.Show(ex.Message, "database")
End Try
but it is giving the error like ...
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
then i closed all the files , even i restarted the system ....
but it is giving the error...
wt would be the problem ....
either in setting the password for the database
or in vb.net ( in the above code )
plz help me....
thanks in advance
vijay
|
|
|
|
|
try this code
I think this will work
' your connection string will be
Provider=Microsoft.Jet.OLEDB.4.0;Data Source = D:/DataBase/Master.mdb ; Persist Security Info=True ;Jet OLEDB:Database Password=xyz" 
|
|
|
|
|
Reverse the slashes in your connection string. Forward slashes are for command line parameters. Backslashes (\) are for file path names.
Your Access database has either has a database password or workgroup security setup on it. You can find the connection string format for this at http://www.connectionstrings.com[^]. You're using OLEDB (.NET). Do not use the ODBC versions!
If you have workgroup security, you have to specify the databases .MDW file in the string along with the database filename.
|
|
|
|
|
hai dave
thank u so much ....
its working ...
i used the connection strings site which u given...
thank u so much ....
really i mwaiting for it since from 1 week ....
once again thank u so muchhh ...
oke bye
vijay
|
|
|
|
|
hai friends
i given security with code
i.e on execution of the project , it will ask "enter Project Access Key "
then the user enters the key and the execution continues.
but the problem is ..
if the user closes the application/shut down the computer , it is again asking the Key...
i want to ask the only once when the project is run for the first time only....
plz help me ....
thanks in advance
vijay
devulapally_vijay@yahoo.co.in
|
|
|
|
|
You can store the key in the registry, or in a config file, or in any sort of file you like, really. I tend to come up with my own file format to store stuff like that, but what you do is up to you. Then your code needs to check if the file exists and the key is valid, obviously.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I want to show my print preview to user in landscape but now it depends on user printer setting .
please help me how to do that .
thanks .
en.Mahdi
|
|
|
|
|
Hello all,
I am trying to write a VB program that will listen to signals coming from com ports, the kind of program that listens to signals coming from a bar code scanner, etc. (the scanner reads a bar code, sends the info to a comport, then the signal is picked up by a listening software). I've been looking online for materials on the subject, but did not come across any written in VB. Most are written in C and Java, which leads me to think that perhaps you can't do it with VB. If you know where I can find info for what I am looking for, please inform me. Thank you in advance for your time.
modified on Friday, April 11, 2008 11:48 PM
|
|
|
|
|
Which version of VB?? VBA, VB6, VB.NET 2002 (.NET 1.0), VB.NET 2003 (.NET 1.1), VB.NET 2005 (.NET 2.0 and 3.0), or VB.NET 2008 (.NET 2.0, 3.0, and 3.5)??
|
|
|
|
|
I am currently using VB2005 .net 2.0 and if you know of a website that talks about what I am trying to do, please inform me. Thanks again for your time.
|
|
|
|
|
|
You'd use the Serial Port class[^] included in the System.Io Namespace
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Hello everyone,
Thank you for your time, you've been helpful. I am checking out all of your suggestions.
|
|
|
|
|
hey all, ok i have this really small program that needs one more thing to get it completed and i am extremly new to visual basic and i just can't figure this out.
Ok, so this is a program that when u debug it, you put in you first and last name and then click calculate, then an inputbox comes up asking: "What grade do you teach?" you can put any grade in, so i put "6" in (without the quotes) and then when i click ok another box comes up and is susposed to say, "John Smith teaches grade 6" but when i click the ok button it only displays "John smith teaches grade" and doesn't display the number 6, that's all i am tryign to display. Does any one no how to get that number 6, or any number really to be displayed? If you could check this out that'd be great! Here is the code, the interface is 2 text boxes, 1 asking for your first name and the other asking for your last name, and a button saying "calculate"
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Employee As New Person
Dim strgrade As Integer
Dim DOB As Date
Employee.FirstName = TextBox1.Text
Employee.LastName = TextBox2.Text
strgrade = InputBox("What Grade Do you Teach?", "Grade Ask")
MessageBox.Show(Employee.FirstName & " " & Employee.LastName _
& " teaches grade " & Employee.Age(DOB) & "")
End Sub
End Class
Public Class Person
Private Name1 As String
Private Name2 As String
Public Property FirstName() As String
Get
Return Name1
End Get
Set(ByVal value As String)
Name1 = value
End Set
End Property
Public Property LastName() As String
Get
Return Name2
End Get
Set(ByVal value As String)
Name2 = value
End Set
End Property
Public Function Age(ByVal Birthday As Date) As Integer
Return Int(Now.Subtract(Birthday).Days / 365.25)
End Function
End Class
Public Class Teacher
Inherits Person
End Class
/J-Man\
|
|
|
|
|
jesseax wrote: strgrade = InputBox("What Grade Do you Teach?", "Grade Ask")
MessageBox.Show(Employee.FirstName & " " & Employee.LastName _
& " teaches grade " & Employee.Age(DOB) & "")
Did you try stepping through the code?? You get a string value from an InputBox and you store it in strgrade . Then what does your code do with it??
|
|
|
|
|