A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

i cant find CurrentProject.Path help!



 
 
Thread Tools Display Modes
  #1  
Old August 30th, 2006, 07:53 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 5
Default i cant find CurrentProject.Path help!

im using vb6 and MSaccess 2003
Public Sub OpenDBConnection()
Dim strPath As String
strPath = CurrentProject.Path error CurrentProject or
CurrentApplication
If Right$(strPath, 1) "\" Then
strPath = strPath & "\"
End If
strconek = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
strPath & "\data\MFMS.mdb;Persist Security Info=False"
Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
'strconek = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\sysnow\data\MFMS.mdb;Persist Security Info=False"
conn.CursorLocation = adUseClient
conn.Open strconek
End Sub
is there something wrong with my references

  #2  
Old August 30th, 2006, 08:19 AM posted to microsoft.public.access.forms
RoyVidar
external usenet poster
 
Posts: 417
Default i cant find CurrentProject.Path help!

" wrote in message
om:
im using vb6 and MSaccess 2003
Public Sub OpenDBConnection()
Dim strPath As String
strPath = CurrentProject.Path error CurrentProject or
CurrentApplication
If Right$(strPath, 1) "\" Then
strPath = strPath & "\"
End If
strconek = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
strPath & "\data\MFMS.mdb;Persist Security Info=False"
Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
'strconek = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\sysnow\data\MFMS.mdb;Persist Security Info=False"
conn.CursorLocation = adUseClient
conn.Open strconek
End Sub
is there something wrong with my references


If you're using VB6, then you probably wont find currentproject.path.

Currentproject is a property of the Access application object, and
allows access to the CurrentProject object with related objects,
properties and methods within Access, and, as far as I know, is
available only from Access VBA code (or through automation).

I think you will need other means of retrieving the path, where I
think an NG dedicated to VB6 might be a better place to look. Is
App.Path the equivalent in VB6?

--
Roy-Vidar


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.