Re: Access mdb file



Do I need to use create connection or create database? The code I'm
executing comes up with a Login form asking me for a username and password
to access the mdb file. Is there a default username and password I should
try? The code is as follows:

cFile = "MyTest.mdb"
cconn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" + cFile + ;
";Exclusive=1;Uid=admin;Pwd="

nConn=SQLSTRINGCONNECT(cConn)
IF nCOnn>0
messagebox("Connected")
nerg = SQLEXEC(nCOnn,'Select * from tblPhoneBook','dummy2')
messagebox(str(nerg))
if nerg>0 && Now data is in cursor dummy2

SELECT dummy2
mesasagebox(alias()) + str(reccount())
browse && or so
endif
SQLDISCONNECT(nConn)
ENDIF
CLOSE DATABASES


"Dan Freeman" <spam@xxxxxxxxxxxxx> wrote in message
news:eC9rciLtFHA.1848@xxxxxxxxxxxxxxxxxxxxxxx
>A value less than 0 means the query failed. Use AERROR() to create an array
> of errors and find out why the query failed.
>
> Dan
>
>
> Mike wrote:
>> Hello - can someone please elaborate on this. When I test this the
>> value in nerg is -1. Do I need to use create connection or something
>> before running this code or is this code all I need. Are there any
>> step by step instructions on how to create a query from a table in an
>> mdb file? This code and the code from the other replies in this
>> thread is not working.
>>
>> Thanks,
>>
>> "tom knauf" <hbgmail@xxxxxxxxxx> wrote in message
>> news:dbfnjj$h1n$02$1@xxxxxxxxxxxxxxxxxxxx
>>> Hi,
>>>
>>> if you just want to read from access (and know/ask user for the
>>> tablename)
>>> we use code like this :
>>>
>>> cFile = "d:\Daten.mdb"
>>> cconn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" + cFile +
>>> ";Exclusive=1;Uid=admin;Pwd="
>>> nConn=SQLSTRINGCONNECT(cConn)
>>> IF nCOnn>0
>>> nerg = SQLEXEC(nCOnn,'Select * from table1','dummy2')
>>> if nerg>0 && Now data is in cursor
>>> dummy2 SELECT dummy2
>>> browse && or so
>>> endif
>>> SQLDISCONNECT(nConn)
>>> ENDIF
>>> CLOSE DATABASES
>>>
>>> You do NOT need a sqlserver or msde, just installed acces or
>>> installed access odbc drivers.
>>>
>>> HTH
>>> Tom
>>>
>>>
>>>
>>>
>>> "Jan" <nomail@xxxxxxxxxxx> schrieb im Newsbeitrag
>>> news:uyoDTfdiFHA.3336@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Hi all,
>>>>
>>>> I have a small app that does some reporting from legacy dbf files.
>>>> The app
>>>> that created the dbf files has been migrated to a windows app and
>>>> now produces mdb files. What do I need to access mdb files from
>>>> vfp? I would like to add this as an option to my existing reporting
>>>> app so that the user can choose from their older files or their
>>>> newer ones to produce the report.
>>>>
>>>> Some sample code would be useful as would a pointer to the
>>>> available syntax to do this.
>>>>
>>>> TIA
>>>> Jan
>
>


.



Relevant Pages

  • Re: Great Restaurant in Miami - next time you are in South Florida
    ... Zakariya, in front of databases ... cosmetic and immediate, fixs in connection with it, noticing ...
    (sci.crypt)
  • Re: IIS6 Dynamic pages execusion problem
    ... I'm sure that connection objects to databases are closed probably and the ... "Rany M. Sabry" wrote in message ... > I have a number of Web Servers running IIS6 hosted on Windows 2003 ...
    (microsoft.public.inetserver.iis)
  • Re: Switching ODBC Oracle databases
    ... Also is there something in the connection string I am using that causes ODBC ... "Lynn Trapp" wrote: ... databases in the 10th and then you would only have to create the single ODBC ...
    (microsoft.public.access.externaldata)
  • Re: Setting NO COUNT default on a connection only(not the entire datab
    ... In the case of ADO.NET I suggest use of the SqlClient namespace--not OleDb. ... Hitchhiker's Guide to Visual Studio and SQL Server ... ON for a specific SQL Server connection? ... We have some databases that will need to be consolidated onto a sinlge ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Changing a DataAdapter connection
    ... Assign new connection to adapter's command instances ... > I have several servers hosting SQL databases. ... > I have a ComboBox that let me chose the server, ...
    (microsoft.public.dotnet.general)