googlexx Posted July 9, 2009 Share Posted July 9, 2009 i have a mdb file on a webserver and im trying to connect to it but its not working.... this is the error: Parse error: syntax error, unexpected T_VARIABLE $conn = new CreateObject("ADODB.Connection") // Microsoft Access connection string. $conn->Open("Provider=Microsoft.ACE.OLEDB.12.0; Remote Server=http:1.1.1.1:8080; Data Source=season.mdb;"); Quote Link to comment Share on other sites More sharing options...
btherl Posted July 9, 2009 Share Posted July 9, 2009 $conn = new CreateObject("ADODB.Connection"); // Microsoft Access connection string. $conn->Open("Provider=Microsoft.ACE.OLEDB.12.0; Remote Server=http:1.1.1.1:8080; Data Source=season.mdb;"); That should fix your parse error. Then you can see if the code actually works. There was a missing ";" symbol. Quote Link to comment Share on other sites More sharing options...
googlexx Posted July 9, 2009 Author Share Posted July 9, 2009 ah thnx... now i get Fatal error: Class 'CreateObject' not found Quote Link to comment Share on other sites More sharing options...
btherl Posted July 9, 2009 Share Posted July 9, 2009 Where did you get this sample code from? Quote Link to comment Share on other sites More sharing options...
trq Posted July 9, 2009 Share Posted July 9, 2009 Yeah, funny that. There is no such object as CreateObject in php. That looks more like VbScript to me. Take a look at the com extension. Quote Link to comment Share on other sites More sharing options...
googlexx Posted July 9, 2009 Author Share Posted July 9, 2009 oops haha, ok i changed it but not im getting: Fatal error: Class 'COM' not found $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); // Microsoft Access connection string. $conn->Open("Provider=Microsoft.ACE.OLEDB.12.0; Remote Server=http:1.1.1.1:8080; Data Source=C:\xampp\htdocs\season.mdb;"); Quote Link to comment Share on other sites More sharing options...
trq Posted July 9, 2009 Share Posted July 9, 2009 It would appear you don't have the com extension installed. If you have odbc installed you could use that. See odbc_connect. Quote Link to comment Share on other sites More sharing options...
googlexx Posted July 9, 2009 Author Share Posted July 9, 2009 alright how do i use this example to connect to a remote mdb? i don't quite get it whats the username and pass for and where do i put in an ip? // Microsoft Access $connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $password); Quote Link to comment Share on other sites More sharing options...
googlexx Posted July 11, 2009 Author Share Posted July 11, 2009 any1 know how? im stuck Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.