473,516 Members | 3,465 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\extensions\ModuleInforma tion\ModuleInformation.php:49 Stack trace: #0 C:\xampp\htdocs\mediawiki\extensions\ModuleInforma tion\ModuleInformation.php(49): com->execute('SELECT * FROM m...') #1 C:\xampp\htdocs\mediawiki\includes\parser\Parser.p hp(3287): renderModuleInformation(NULL, Array, Object(Parser)) #2 C:\xampp\htdocs\mediawiki\includes\parser\Preproce ssor_DOM.php(982): Parser->extensionSubstitution('renderModuleInf...', Array) #3 C:\xampp\htdocs\mediawiki\includes\parser\Parser.p hp(2678): PPFrame_DOM->expand(Array, Object(PPFrame_DOM)) #4 C:\xampp\htdocs\mediawiki\includes\parser\Parser.p hp(966): Parser->replaceVariables(Object(PPNode_DOM), 0) #5 C:\xampp\htdocs\mediawiki\includes\parser\Parser.p hp(321): Parser->internalParse('parse('getPreviewText('getPreviewT ext() #9 C:\xampp\htdocs\mediawiki\includes\EditPage.php(48 4): EditPage->showEditForm() #10 C:\xampp\htdocs\mediawiki\includes\EditPage.php(34 9): EditPage->edit() #11 C:\xampp\htdocs\mediawiki\extensions\FCKeditor\FCK editor.body.php(202): EditPage->submit() #12 C:\xampp\htdocs\mediawiki\includes\Hooks.php(117): FCKeditor_MediaWiki->onCustomEditor() #13 C:\xampp\htdocs\mediawiki\includes\Wiki.php(484): wfRunHooks() #14 C:\xampp\htdocs\mediawiki\includes\Wiki.php(59): MediaWiki->performAction(Object(Article), Object(StubUser)) #15 C:\xampp\htdocs\mediawiki\index.php(93): MediaWiki->initialize(Array, 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 3270
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
4528
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...
1
8787
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"...
2
4519
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
14703
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...
0
7273
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
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...
0
7405
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7547
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...
0
5712
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5106
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3265
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...
0
1620
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
1
823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.