473,657 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weird problem with PDO/ODBC and Access

I have an Access database and a table. One of the columns was a memo
field. If I execute a 'select * from table', all the rows would be
retrieved but the columns after the memo column had null data.

If I moved the memo field to the end and executed the same SQL the data
was retrieved propery.

Also if I specified the column name by itself (E.g. select phone from
table' ), the data was retrieved.

Has anyone seen this kind of problem with any other databases where a
memo field must be the last one?

Aug 13 '06 #1
3 3694
On 13 Aug 2006 12:35:17 -0700, "Costas Menico" <cm*****@gmail. com>
wrote:
>Has anyone seen this kind of problem with any other databases where a
memo field must be the last one?
Could it be something to do with the length?
<http://www.php.net/manual/en/function.odbc-longreadlen.php refers.
--
Locate your Mobile phone: <http://www.bizorg.co.u k/news.html>
Great gifts: <http://www.ThisBritain .com/ASOS_popup.html >
Aug 14 '06 #2
It seems to happen with a short table too.
I am using PHP5.1 under Windows XP of course.

I made a small table and added 2 rows with info in all columns and here
is the layout:

LastName - text,
notes - memo,
addr - text,
zip - text

Here is the code. It fails in $cursor and $cursor1 but works when notes
is last in $cursor2.

<?php
$tbl='tblNotes' ;

$user='';
$pass='';
$conn = "DSN=mailing;Dr iver=Microsoft Access Driver";
try {
$dbh = new PDO("odbc:$conn ", $user, $pass);

// prints nulls after NOTES
$cursor=$dbh->query("SELEC T * from $tbl order by LastName");
foreach ($cursor as $row) {
$row=array_chan ge_key_case($ro w, CASE_UPPER);
echo $row['LASTNAME'] . '|';
echo $row['NOTES'] . '|';
echo $row['ADDR'] . '|';
echo $row['ZIP'] . '|';
echo "\n";
}
echo "\n";

// Also prints nulls after NOTES
$cursor1=$dbh->query("SELEC T LastName, notes, addr, zip from $tbl
order by LastName");
foreach ($cursor1 as $row) {
$row=array_chan ge_key_case($ro w, CASE_UPPER);
echo $row['LASTNAME'] . '|';
echo $row['NOTES'] . '|';
echo $row['ADDR'] . '|';
echo $row['ZIP'] . '|';
echo "\n";
}
echo "\n";

// prints all columns correctly because I moved notes to be last
$cursor2=$dbh->query("SELEC T LastName, addr, zip, notes from $tbl
order by LastName");
foreach ($cursor2 as $row) {
$row=array_chan ge_key_case($ro w, CASE_UPPER);
echo $row['LASTNAME'] . '|';
echo $row['NOTES'] . '|';
echo $row['ADDR'] . '|';
echo $row['ZIP'] . '|';
echo "\n";
}

} catch (PDOException $e) {

echo $e->getMessage() ;

}
$dbh = null;
?>
Result when you run this:
$cursor
doe|mm|||
smith|xx|||

$cursor1
doe|mm|||
smith|xx|||

$cursor2
doe|mm|120 main street|10006|
smith|xx|320 bway|10007|

Aug 14 '06 #3

Costas Menico wrote:
I have an Access database and a table. One of the columns was a memo
field. If I execute a 'select * from table', all the rows would be
retrieved but the columns after the memo column had null data.

If I moved the memo field to the end and executed the same SQL the data
was retrieved propery.

Also if I specified the column name by itself (E.g. select phone from
table' ), the data was retrieved.

Has anyone seen this kind of problem with any other databases where a
memo field must be the last one?
That's a known limitation of ODBC I think. Once the driver goes into
blob retrieval mode, it can't retrieve fixed width columns anymore.

Aug 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3531
by: DD | last post by:
Hello, Could anyone please help me?? Is there somebody who could explain me how to make a connection to a access database with a python cgi script. I would like to use common sql commands in my python scripts as I can with MySQLdb. But I cannot even connect to the access database (see below). Could anyone explain it to me as simple as possible please. I'm using Windows XP, ActivePython 2.3.2 build 230 and Microsoft access(XP?)
13
3794
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a counter functionality and read/insert some data in a MS Access database on that Windows 2003 server. The weird part is, as long as the web page is very short in size, I can hit the refresh button and Internet Explorer will reload the page and display...
11
3750
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
6
6764
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
7
2286
by: Neil Ginsberg | last post by:
I'm having some problems with an Access 2000 MDB file with a SQL Server 7 back end, using ODBC linked tables. I previously wrote about this, but am reposting it with some additional information and in summary form, in hopes that someone might have an idea about what's going on. I am using a bound form which is losing data a significant portion of the time. Basically, the form contains 6 fields and three subforms, as follows: Field A...
2
1502
by: somersbar | last post by:
im trying to get a table from a microsoft access database on a simple web form using visual basic.net. ive set up the database as a file dsn. this is my connection string: DBQ=C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb;DefaultDir=C:\Program Files\Microsoft Office\OFFICE11\SAMPLES;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\Program Files\Common
0
12040
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in '/CinemaBookingSystem' Application. -------------------------------------------------------------------------------- ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process
1
6023
by: Chevylover54 | last post by:
We have been using ODBC connections that are in the registry of the computer. However these connections aren't in by default so when a new user uses the Access program or when a current user goes to a different computer, we have to send them the batch program to put the ODBC hooks on that machine. We want to get around that by using Pass-Through queries and the ODBC connection string. What we have got to work is this: ...
3
2656
by: ericooi1976 | last post by:
My problem was it will prompt this message "An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred in system.data.dll", when i click many time of a button "A" that will call the function below: I noticed when everytime click on the button "A", the function below will run for 3 times, because got other events also call this function to get the value. I have this function to get a single value from access table when...
0
8315
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
8734
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
8508
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
7341
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
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();...
1
2733
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
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
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.