I have developed a program that is now being used on several PCs and it is working great on all of them except from 1 which uses windows 2000 (the rest run on XP).
The peice of code in question creates a new record in a table, updates a record in an existing table and then refreshes the information on the screen.
The reason why i posted so little information was i assume (Correct me if i'm wrong) that this isn't a problem with my code because it is working fine on five other computers but rather a problem with VS 2002 and Windows 2000 (or something not being installed on that computer) and was intreasted if anyone else had even heard of such a problem.
If you think that the code would help then please let me know and I will post it.
Does the Win 2000 PC have the same version of the .NET Framework as the XP PCs?
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
Although not the exact problem you describe, it may be a missing patch, or as jebenson says the version of the .NET Framework, or even the version of your data access components.
frm.Close()
cbo_productselect.SelectedIndex = currentindex
' new_stage_date = get_working_hours_datetime(DateAdd(DateInterval.Hour, durationH, DateAdd(DateInterval.Day, durationD, CDate(txt_exp_stream_comp.Text))))
Dim conn As New ADODB.Connection()
Dim cmd As New ADODB.Command()
Dim rs As New ADODB.Recordset()
cmd1.CommandText = "SELECT SUM(dbo.Stages.P_duration_H) AS Hours, SUM(dbo.Stages.p_duration_D) AS Days from Product_Stages LEFT OUTER JOIN Stages ON Product_Stages.Stage_diwor = Stages.Diwor RIGHT OUTER JOIN Stream ON Product_Stages.Product_Diwor = Stream.Product_Diwor WHERE (dbo.Product_Stages.Diwor NOT IN (SELECT product_stage_diwor FROM stream_stages WHERE stream_diwor = " & cbo_productselect.SelectedValue & ")) AND (dbo.Stream.Diwor = " & cbo_productselect.SelectedValue & ") GROUP BY Stream.Diwor HAVING(SUM(Stages.P_duration_H) > 0) OR (SUM(Stages.p_duration_D) > 0)"
If rs1.EOF = False And rs1.BOF = False Then
new_stream_date = get_working_hours_datetime(DateAdd(DateInterval.Hour, rs1.Fields("Hours").Value, DateAdd(DateInterval.Day, get_totaldays_from_working_days(new_stage_date, rs1.Fields("days").Value), new_stage_date)))
Else
MsgBox("Unable to calculate completion time!", MsgBoxStyle.Exclamation, "Error")
End If
'Just checks to see if a date is on a working day
Public Function isworkingday(ByVal start_date As Date) As Boolean
Dim conn As New ADODB.Connection()
Dim cmd As New ADODB.Command()
Dim rs As New ADODB.Recordset()
'get the public holidays from the database
'checks to see that the day of the week is ok
If Weekday(start_date) <> 1 And Weekday(start_date) <> 7 Then
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=MortTrak;Data Source=PHEONIX"
conn.Open()
cmd.CommandType = ADODB.CommandTypeEnum.adCmdText
cmd.CommandText = "select * from public_holidays where convert(datetime,hol_Datetime,103) > convert(datetime,'" & start_date & "',103)"
cmd.ActiveConnection = conn
rs.Open(cmd, , ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
'checks to see if the start date is equall to any of the public hols
Do Until rs.EOF
If rs.Fields("hol_Datetime").Value = start_date Then
Return False
Exit Function
End If
rs.MoveNext()
Loop
Ok having installed VS.net on a win 2000 workstation i can now tell you that the error occurs somewhere compleatly diffrent than where i thought it did....
Red Text = Line of Error
Private Sub cmd_OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_OK.Click
'This fources them to enter a sensible reason for the delay
If Len(txt_comment.Text) < 20 Then
MsgBox("You must enter a sensible reason for this delay!", MsgBoxStyle.Exclamation, "Error")
Exit Sub
End If
Dim rs As New ADODB.Recordset()
Dim conn As New ADODB.Connection()
Dim cmd As New ADODB.Command()
'open the delayes table for writing too
conn.ConnectionString = connection_string
conn.Open()
cmd.CommandType = ADODB.CommandTypeEnum.adCmdText
cmd.CommandText = "select * from delayes"
cmd.ActiveConnection = conn
rs.Open(cmd, , ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
'Add a new record and record the deatils
rs.AddNew()
rs.Fields("Stage").Value = stage
rs.Fields("case_diwor").Value = case_diwor
rs.Fields("Stream_diwor").Value = Stream_diwor
rs.Fields("Delayed_Reason").Value = cbo_reason.Text rs.Fields("Delay_duration_days").Value = DateDiff(DateInterval.Day, expected_date, DTPdays.Value)
rs.Fields("Delay_duration_Hours").Value = IIf(txthours.Text = "", 0, txthours.Text)
rs.Fields("comments").Value = txt_comment.Text
rs.Fields("user_diwor").Value = user_diwor
rs.Update()
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.