Re: odbc




"Rysiek" <rickneo_@xxxxxxxxxxxx> wrote in message
news:20060405153355.65c539ae@xxxxxxxxxxxxxxxxxxxx
O


I'm afraid I don't know anything about php. Is this running on
Windows? If so, you should be able to use an ADO connection without
needing any dsn file.
As I don't know anything about access :) It's all done under
Windows. Anyway it seems not to be a problem with php. When I try for
example to compact database (on system DSN tab there's a option to do
this), I receive the same error.
Hmm, "ADO connection" could you in short describe this ?

But anyway, did you try removing the database password? (hopefully
you believe me that it should be removed)
Of course I believe, but I'm not allowed do this. I've got access to
this *.mdb file "as is".


Dobrze.
If you are running Windows, you can create a plain text file with note pad
and cut and paste the code below. Change the username, passwords and file
locations, then close and save the file as TestMe.vbs and then run it by
double-clicking it.

This will verify that you really do have the right details. Once you have
done this test, you can move on to changing the code to do some useful work
with the database - such as reading or updating the data.



' **** Code Starts *******
Option Explicit

If TestDb()=0 Then
MsgBox "I can connect"
Else
MsgBox "I cannot connect"
End If


Function TestDb()

On Error Resume Next

Dim cnn
Dim strConn
Dim strSQL
Dim lngReturn

lngReturn=1

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\MyFolder\Database.mdb;" & _
"Jet OLEDB:System Database=C:\MyFolder\Workgroup.mdw;" & _
"User Id=MyLoginName;Password=MyPassword;" & _
"Jet OLEDB:Database Password=DatabasePassword;"

Set cnn = CreateObject("ADODB.Connection")

cnn.Open strConn

If Not cnn Is Nothing Then
If cnn.State > 0 Then
lngReturn=0
cnn.Close
End If
Set cnn = Nothing
End If

End Function
' **** Code Ends *******


.



Relevant Pages

  • Re: Reading IE browser contents?
    ... The Document object represents the loaded page. ... "Microsoft Shell Controls and Automation" ... Dim ie2 As InternetExplorer ... windows AND IE windows. ...
    (microsoft.public.vb.general.discussion)
  • Re: function PlaySound does not work
    ... You need to use any of several methods to get the Windows directory. ... Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long ... Public Function GetWinDir() As String ... Dim sBuffer As String ...
    (microsoft.public.vb.winapi)
  • RE: GetOpen filename to open files(Workbooks)
    ... As I said previously you can't circumvent the windows security protection ... Set FileNameXls = Workbooks.Open(_ ... Dim FileNameXls As Variant ... Dim ShName As String, PathStr As String ...
    (microsoft.public.excel.misc)
  • Re: Improving Application Performance by DISABLING hardware acceleration?
    ... I found a similar issue when using Windows Media Encoder for screen capture ... Another issue that Disabling Hardware Acceleration seems to solve, ... Dim hSDC, hMDC, hMDC2 As Integer ... > improve performance when operating on in-memory DDBs. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: How do I update Word 2002 to create merged faxes?
    ... If you have Windows 2000 or Windows XP, the "official" way is to have the ... If you're going to try it, please read the notes, modify the macro to suit ... Dim bFaxServerAvailable As Boolean ... Dim oFaxPorts As FAXCOMLib.FaxPorts ...
    (microsoft.public.word.mailmerge.fields)