I am using vb6, dbaseIII, on both (win2k sp4, and winXP SP3)

On the win2k PC the program works fine, and on the XP PC, not so much.

Problem, I am opening a recordset from .dbf file 'miheader1' but it seems that it is pulling the file named 'miheader'. The file with the '1' after is a temp file that is being added to the other. In this particular part of the program the date field of 'miheader1' is being modified. below is the code. The argument supplied is "3"

vb Code:
  1. Private Sub CheckDate(Optional Flag As Integer = 0)
  2.     Dim FillvdateTest As Long
  3.     Dim oRS As String
  4.     StorePath = "c:\mv"
  5.     If Flag = 1 Then 'marvell
  6.         DBName = "mvheader1"
  7.     ElseIf Flag = 2 Then 'brinkley
  8.         DBName = "brheader1"
  9.     ElseIf Flag = 3 Then 'marianna
  10.         DBName = "miheader1"
  11.     Else
  12.         DBName = InputBox("Enter the name of the database (MVheader1, BRheader1, MIheader1)", "Header Name", "MVheader1")
  13.     End If
  14.     Text1.Text = Text1.Text & "*****************************" & vbCrLf
  15.     Text1.Text = Text1.Text & "*****************************" & vbCrLf
  16.     Text1.Text = Text1.Text & "*******" & DBName & "**********" & vbCrLf
  17.     Text1.Text = Text1.Text & "*****************************" & vbCrLf
  18.     Text1.Text = Text1.Text & "*****************************" & vbCrLf
  19.     Text1.Text = Text1.Text & "opening connection to db" & vbCrLf
  20.     Call OpenConnection
  21.     Text1.Text = Text1.Text & "connection open" & vbCrLf
  22.     If RS.State <> 0 Then
  23.         RS.Close
  24.     End If
  25.     Text1.Text = Text1.Text & "opening Recordset " & vbCrLf
  26.     oRS = "select hdr_date from " & DBName & " order by hdr_date asc"
  27.     Text1.Text = Text1.Text & oRS & vbCrLf
  28.     Text1.Text = Text1.Text & "rs state = " & RS.State & vbCrLf
  29.     RS.Open oRS, CN, adOpenDynamic, adLockOptimistic
  30.     Text1.Text = Text1.Text & "rs state = " & RS.State & vbCrLf
  31.     Text1.Text = Text1.Text & "recordset was opened successfully" & vbCrLf
  32.     RS.MoveFirst
  33.     FillvdateTest = RS.Fields(0).Value
  34.     Text1.Text = Text1.Text & RS.Fields(0).Value
  35.     Text1.Text = Text1.Text & "Test statement" & vbCrLf & "   ~>If FillvdateTest(" & FillvdateTest & ") < 19999999 Then"
  36.     If FillvdateTest < 19999999 Then
  37.         Call FillVDate(Flag)
  38.     End If
  39. End Sub

Note the text1.text statements below is the log
wrapped in code tags just to section off
Code:
*****************************
*****************************
*******miheader1**********
*****************************
*****************************
opening connection to db
connection open
opening Recordset 
select hdr_date from miheader1 order by hdr_date asc
rs state = 0
rs state = 1
recordset was opened successfully
20060130Test statement
   ~>If FillvdateTest(20060130) < 19999999 Then
Fillvdate should = 75723
which is the first date field in 'miheader1'

20060130 is the first date field in 'miheader'

Is there a length limit on dbase names?? remember that it works on the Win2K PC.
Thanks for any pointers. I know the code is sloppy *sorry

-RT