Well, there's good news and bad news. Here's my new code
from modPrimary:
Imports System.io
Module modPrimary
Friend gstrConn As String
= "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" 'H:\HasbaraNET\ado.net
tests\adonetTest\HasbaraSample.mdb;"
Public Sub Main()
Dim strPath As String
Dim strSubstring As String
Dim intIndexof As Integer
Dim cls1 As New Class1
strPath =
System.Reflection.Assembly.GetExecutingAssembly.Location
intIndexof = strPath.IndexOf("bin")
MsgBox(intIndexof.ToString)
strSubstring = strPath.Substring(0, intIndexof)
MsgBox(strSubstring)
'MsgBox(strPath)
'strPath = System.IO.strPath.GetDirectoryName
("adonetTest")
ChDir(strSubstring)
gstrConn = gstrConn & "HasbaraSample.mdb;"
MsgBox(gstrConn)
'indexof
'substring
'MsgBox(strPath)
'strPath = cls1.GetDirectoryName("adonetTest")
'MsgBox(strPath)
Application.Run(New frmTest1)
End Sub
End Module
Now playing with the connect string the way I do along
with
System.Reflection.Assembly.GetExecutingAssembly.Location
I get the job done in an inelegant manner.
But using all sorts of tricks with
'strPath = System.IO.strPath.GetDirectoryName
("adonetTest")
I would just get blanks, empty nulls or nothings for the
directory name. No luck there.
My solution may not be elegant, but until an elegant
solution comes along, my kludge will work just fine.
Thansk for the information
dennis
|