FileOpen with file DSN

T

T.Q. Quach

Hi,

Was anyone successfully to open project from SQL Server using ODBC file DSN.
I was able to open the project using a System DSN but not a file DSN. MS
Project keeps giving an "ODBC Data Source Not Found" error. Here is the
statement that I used,

Application.FileOpen "<D:\Data Sources\tmedb.dsn>\Project2", , , , , , ,
"sa", "sa", "MSProject.odbc"

Thanks in advance
T.Q. Quach
 
R

Rod Gill

Hi,

Try recording a macro of you opening a project with that DSN manually.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
 
T

T.Q. Quach

Hi Rod,

I recorded the macro include all steps that open the project TQ100 from a
specified DSN file. Here is the vba code generated by the macro

Sub OpenFileDSN()
' Macro OpenFileDSN
' Macro Recorded Wed 9/8/04 by T.Q. Quach.
FileOpen Name:="<{SQL Server}>\TQ100", ReadOnly:=False, UserID:="sa",
DatabasePassWord:="sa", FormatID:="MSProject.ODBC"
End Sub


What it does is to read the ODBC driver name from the dsn file and use it in
the Name para.

Thanks
-TQ
 
R

Rod Gill

Hi,

I would change the sa password to something more secure asap. Someone will
hack your system real soon unless you do.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top