473,774 Members | 2,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

exception 'com_exception' with message 'Source: Unknown

2 New Member
I am trying to connect to an access db through php on Windows Server 2003 running XAMPP. The code I am using has worked before on another access db on this server so I am not sure what is causing the error. Here is my code:

Expand|Select|Wrap|Line Numbers
  1. # First establish the connection
  2. $conn = new COM('ADODB.Connection') or exit('Cannot start ADO');
  3. $result = new COM('ADODB.Recordset') or exit('Coult not make rs'); 
  4.  
  5. $db = 'C:\\xampp\\datasources\\ModuleDB.mdb';
  6.  
  7. $connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db;";    
  8. $conn->Open($connStr);
  9.  
  10. if (!$conn) {
  11.     $output .= "Connection not open";
  12.     die();
  13. }
  14.  
  15. $sql = "SELECT * FROM module";
  16.  
  17. $output .= "<br> SQL Statement: " . $sql;
  18.  
  19. ####### ERROR HERE ######
  20. $result = $conn->execute($sql);
  21. ###########################
  22.  
  23. $ouput .= $result;
  24. //$result->close();
  25. $conn->close();
  26.  
  27. # Clean up
  28. $result = null;
  29. $conn = null;  
  30.  
The SQL statement looks find when I print it out. The full error message is:

exception 'com_exception' with message 'Source: Unknown
Description: Unknown' in C:\xampp\htdocs \mediawiki\exte nsions\ModuleIn formation\Modul eInformation.ph p:49 Stack trace: #0 C:\xampp\htdocs \mediawiki\exte nsions\ModuleIn formation\Modul eInformation.ph p(49): com->execute('SELEC T * FROM m...') #1 C:\xampp\htdocs \mediawiki\incl udes\parser\Par ser.php(3287): renderModuleInf ormation(NULL, Array, Object(Parser)) #2 C:\xampp\htdocs \mediawiki\incl udes\parser\Pre processor_DOM.p hp(982): Parser->extensionSubst itution('render ModuleInf...', Array) #3 C:\xampp\htdocs \mediawiki\incl udes\parser\Par ser.php(2678): PPFrame_DOM->expand(Array , Object(PPFrame_ DOM)) #4 C:\xampp\htdocs \mediawiki\incl udes\parser\Par ser.php(966): Parser->replaceVariabl es(Object(PPNod e_DOM), 0) #5 C:\xampp\htdocs \mediawiki\incl udes\parser\Par ser.php(321): Parser->internalParse( 'parse('getPrev iewText('getPre viewText() #9 C:\xampp\htdocs \mediawiki\incl udes\EditPage.p hp(484): EditPage->showEditForm () #10 C:\xampp\htdocs \mediawiki\incl udes\EditPage.p hp(349): EditPage->edit() #11 C:\xampp\htdocs \mediawiki\exte nsions\FCKedito r\FCKeditor.bod y.php(202): EditPage->submit() #12 C:\xampp\htdocs \mediawiki\incl udes\Hooks.php( 117): FCKeditor_Media Wiki->onCustomEditor () #13 C:\xampp\htdocs \mediawiki\incl udes\Wiki.php(4 84): wfRunHooks() #14 C:\xampp\htdocs \mediawiki\incl udes\Wiki.php(5 9): MediaWiki->performAction( Object(Article) , Object(StubUser )) #15 C:\xampp\htdocs \mediawiki\inde x.php(93): MediaWiki->initialize(Arr ay, Array) #16 {main}

All other posts I have seen have a better error message than 'Unknown', so I am kind of stumped. Thanks for the help!
Mar 9 '09 #1
1 3308
Gramma2005
2 New Member
Not really a solution to the problem but I did find an alternative.

I set up a datasource for the database and used the following PHP code, and it works.

Expand|Select|Wrap|Line Numbers
  1. $conn = odbc_connect('Modules','','');
  2. $name = $argv["modulename"];
  3. $sql = "SELECT * FROM module WHERE module_name='" . $name . "'";
  4.  
  5. $rs = odbc_exec($conn, $sql);
  6.  
  7. # Get the fields from this database
  8. while (odbc_fetch_row($rs)) {
  9.  ...
  10. }
  11.  
  12. odbc_close($conn);
  13.  

Some instructions for setting up datasource can be found at:
http://articles.techrepublic.com.com...1-5160904.html
Mar 16 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4559
by: bevis | last post by:
I'm new to sql server and mysql but this seems like it should be a pretty straight forward jdbc connection. But I have spent almost 2 days just trying to get a jdbc connection. Please help if you can. I'm using Eclipse 3.2.2 and I have installed mysql-connector-java-5.0.6-bin.jar. I am trying to connect to SQL Enterprise Manager version 8.0 innstall on a Windows 2003 Server Enterprise Edition. I have been able to successfully test...
1
8826
by: Arif Mohammed | last post by:
Hi, iam using MySql 4.0.1 and jboss-4.0.4.GA Iam getting the following exception when there are more concurrent requests more than 50 in a second Caused by: org.xyz.MyClass: SQL Exception:Deadlock found when trying to get lock; Try restarting transaction, message from server: "Lock wait timeout exceeded; Try restarting transaction" at com.xyz.retrieveDetails(MySessionBean.java:679) at...
2
4555
by: cloudy | last post by:
First at all, i'm sorry, i not good in writing english. i want to retrieve a string from my applet via Javascript. I use a method named ReadAll. public String ReadAll(String StrOut, String Keywords, String condition) { ::: ::: return description; }
4
14730
by: jmitch89 | last post by:
I don't why I get this error: Exception in thread "main" java.lang.NoClassDefFoundError The statement below works just fine: java -cp "appframework-1.0.3.jar;swing-worker-1.1.jar";CurrentStrobe.jar com.visionpro.currentstrobe.CurrentStrobeApp However, the statement below produces the error: java -cp "appframework-1.0.3.jar;swing-worker-1.1.jar" -jar CurrentStrobe.jar Exception in thread "main"...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10040
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.