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;"); Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/ 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. Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/#findComment-871787 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 Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/#findComment-871844 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? Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/#findComment-871850 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. Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/#findComment-871852 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;"); Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/#findComment-871854 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. Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/#findComment-871855 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); Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/#findComment-872205 Share on other sites More sharing options...
googlexx Posted July 11, 2009 Author Share Posted July 11, 2009 any1 know how? im stuck Link to comment https://forums.phpfreaks.com/topic/165305-connect-to-remote-mdb/#findComment-873250 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.