Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A97 function to replace "Current.Project"

Status
Not open for further replies.

thevillageinn

Technical User
Feb 28, 2002
124
US
Maybe I'm missing a reference, but I can't find an Access 97 equivalent to "Current.Project" I'm trying to convert an Access 2000 application to 97.

I don't even know what Current.Project does to try to create my own function.

Any direction or assistance would be greatly appreciated.

-Dan
 
set db = currentdb

something I stole form code posted here

Change this constant to False to use ADO.
#Const USEDAO = True
#If USEDAO Then
Dim rst As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb()
Set rst = db.OpenRecordset("tablename")

#Else
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open _
Source:="Tablename", _
ActiveConnection:=CurrentProject.Connection, _
CursorType:=adOpenKeyset, _
LockType:=adLockOptimistic, _
Options:=adCmdTableDirect
#End If
'code to manipulate recordset
rst.AddNew
rst("fieldname") = newvalue
rst.Update
rst.Close
End If
 
gol4-
Thanks for that info. That is helpful for determining the data that would be returned by "CurrentProject.Connection".

However, my initial question still remains. Is there any sort of equivalent for "CurrentProject" that I can call in a custom made function that will return values like ".path" or ".connection" or any of the other operators that go along with "CurrentProject"?

Thanks again everyone for the excellent help in these forums!
-Dan
 
I misunderstood your question I thought you were attempting to use DAO verses ADO
I could be wrong but if you have these references I think current project will be there.

Microsoft ActiveX Data Objects 2.0 Library, Microsoft ADO Ext. 2.1 for DDL and Security, Microsoft Jet Replication Objects 1.0 Library, and Microsoft 3.6 DAO Object Library. Add references to your project for these libraries
Again sorry for the misdirection
 
oh, thanks...I will check my references, and will post results.

-Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top