Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




SQL Error: [Microsoft][ODBC Microsoft Access Driver] Too Few Parameters


I'm trying to execute the following SQL statement and get the following error.

SELECT DomainNames.DomainName FROM DomainNames WHERE DomainNames.DomainName Like "*ab*" ORDER BY DomainNames.DomainName

SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect

I'm running PHP4, Apache 1.3.12 (Win32) and connecting to an Access database on a Win2K box.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Odbc_exec(): SQL Error: [Microsoft][ODBC Microsoft Access Driver]
i am trying to write to the database through odbc. i get the following error:

Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in c:inetpubwwwroot514VIP_SurveyProcess.php on line 41

my directory has read/write permissions why am i getting this? here is the code as an example:
...
$x = 10;
$querySet = "UPDATE Survey SET $rdoOption = $x";
odbc_exec($objConn, $querySet);
...

Warning: SQL Error: [Microsoft][ODBC Driver Manager]
Cannot get an ODBC (or MSSQL) connection to MS Sql Server 7. Using a system datasource and it connects fine, but PHP does not like it. I've had no problem with NT4 but Win2K is another story...

Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in c:inetpubwwwrootindex.php on line 8

Insert Into Microsoft Access Table Using ODBC
The following lines of code don't return an error but they also do not insert the row into the database:

$SQLText="Insert into member (MailingID, MemberID, [File As], EMail, LetterID, AudienceID, DateSent, Sent) Select $MailingCode, $row[0], '".$row[5]."', '".$row[6]."', $LIDToInsert, $AIDToInsert, '".$DateSent."', 1;";

print '<br>'.$SQLText;

$rs_upd=odbc_exec($link, $SQLText);

if (!$rs_upd) die("Couldn't update database");

I've tested the resulting $SQLText string in Access directly and it works find there so this must be a PHP or ODBC issue.

PHP And Microsoft Access
Is it possible to use php to interface with an ms access database?

Our current database (customers, suppliers etc) is in ms access format and we need to run msaccess. I dont feel like converting the whole database over to mysql and we still need the original system, the idea will be that the staff can access the database on the road thru a webpage.

Exporting To Microsoft Access
I have a PHP website with a mySQL database and a client wants to be able to see the database on his computer using Microsoft Access.

I would like to be able to make a special backdoor section for him, where he enters his username and password and is given a link which will make take a snapshot of the mySQL database and convert it to a Microsoft Access database which he can download to his computer.

Is this possible?

Since he isn't very computer savvy I need a way as user friendly as possible to let him download the database and view on his local computer.

Microsoft Access -> PhpMyAdmin
Alright, so what’s going on is that I have coded an entire website with in mind to have an Access Database. So everything works great...

But now I am faced with the problem that I have to have my webpage work with phpMyAdmin, which works completely differently in running my sql statements and everything, ie: ->EOF, select statement, etc...

Is there a way for me to have a smooth transition for my code to work with phpMyAdmin instead of Access at the moment, because recoding all of this means an enormous amount of work with not much free time left on my hands. Code:

Microsoft Access Dropdown List
l am building a new site using PHP which has a lot of pages pulling from an Access Database. I would like to have a dropdown list that pulls exhibitions from the database and then when the user selects one it shows the rest of the details from DB just below the dropdown list, hope that makes sense. Code:

Inserting A Date Into A Microsoft Access 97 Database
I was wondering if anyone could help me insert a short date into microsoft access 97 using php? i can insert text no problem but i can't seem to be able to insert a date properly. i have been using

//$date = "#" . "$sqlmonth" . "1" . "$cboyear" . "#";

$strSQL = "INSERT INTO tblSupport (tDate) VALUES ($date)";
$result = odbc_exec($connect, $strSQL);

Note: i can insert a date if i hard code it like putting in #01

Parse Error For Microsoft.XMLHTTP
I want the following ASP code to be rewritten in PHP:

<%
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.mydomain.com", False
xml.Send
Response.Write(xml.responseText)
%>

I tried myself with ASP2PHP conversion tool. The following code was generated. But does not work. I get a parse error. Please help!

<?PHP
$xml->Open "GET" "http://www.mydomain.com" $False;
$xml->Send;
echo $xml->responseText;
?>

Microsoft JET Database Engine Error '80040e10'
I am new to ASP, I am trying to create a page using ASP that will read from a database and write to my page, but I get this error every time: Microsoft JET Database Engine error ?e10' No value given for one or more required parameters.

PHP On Microsoft-IIS/6.0
Is it possible to make IIS parse .html files the same way as Apache does
with AddType application/x-httpd-php .html in .htaccess?

Microsoft SQL Connection
I am looking to have a php page that will have a required include of a
config file with the MS SQL connection creation. I want to have a form
that saves into a MS SQL database. Could call out to a stored
procedure or have inline code in the php page.

Anyone have examples or generic sample code I can use?

PHP With Microsoft Sharepoint ?
I would like to ask if I can synchronize Sharepoint Services with my PHP
website?

Hint: I think it can be done by XML as a bridge.. but I am not sure and
wanna be sure.

PHP And Microsoft Word
I have users who can sent a Word document as an attachment to an email
from a Microsoft-rich environment. I would like to be able to
"capture" that attachment as a blob and deposit it into a mysql
database. I am not sure how to do the capture.

PHP To Microsoft Outlook
Is it possible to send meeting notifications to microsoft outlook through php? I guess it would be sort of an e-mail sent to an individual telling them they have been invited to attend an event and the event info is automatically added to thier outlook calender or something?

ODBC: WBEM Driver
I would like to access W2K Eventlog from PHP via ODBC - access to the
system is enabled by "WBEM Driver" (supplied on the W2K CD). My code
looks like this:

$connection = odbc_connect("WBEM Source", "", "")
or die(odbc_errormsg());

$select = "SELECT * FROM Win32_NTLogEvent WHERE Logfile =
'Application'";

$query_result = odbc_do($connection, $select)
or die(odbc_errormsg());

odbc_fetch_row($query_result);
echo odbc_result ($query_result, 1);
odbc_close($connection);

Error produced: "Warning: odbc_do(): SQL error: [Microsoft][WBEM ODBC
Driver][ISAM]Failed to obtain provider interface, SQL state S0000 in
SQLExecDirect".

I suspect I need to pass WMI namespace 'rootcimv2' to the
odbc_connect() function (like with
C:WINNTsystem32wbemwbemtest.exe) - but HOW? I've found only
examples for ASP or VB on the Internet. Thanks in advance.

Microsoft Exchange Server
Do any of you know a free PHP script that does the same stuff as Microsoft
Exchange Server?

Microsoft SAPI Problem With PHP
As I've found tons of VB and C# sample codes, I was trying to transform

it into PHP code, using the COM objects. My aim is to create a simple
html, that creates a wav from a text. Here's what I've tried -the php
script part-:

$Voice = new COM("SAPI.SpVoice");//works
//com_load_typelib("SAPI.SpVoice"); //This doesn't help...
$Voice->Speak("Hello!"); //works

$FileStream = new COM("SAPI.SpFileStream"); //works - I mean no error
$FileMode = SpeechStreamFileMode.SSFMCreateForWrite;// = 3 //works -
no error
$FileStream->Open("c:a.wav", 3, false); //works - no error
$Voice->AllowAudioOutputFormatChangesOnNextSet = false; //works - no
error
$Voice->AudioOutputStream = $FileStream; //HERE'S THE PROBLEM

$Voice->Speak("Hello world",1);
$FileStream->Close();

Here's the error I get for that line:
Uncaught exception 'com_exception' with message 'Error [0x80020003]
Member not found

PHP Wrapper For Microsoft SAPI
I can not figure out the reason why this does not go past step 2, it will not go to 2a. Code:

Microsoft Word Formatter
Anyone know of some sort of php script that can read and format Microsoft word documents?

PHP / Microsoft SQL V7/2000 - Page Results
Anyone know a simple way to page results of a SQL Select using Microsoft SQL ? I don't believe they have anything as handy as MySQL LIMIT.

How To Embed Microsoft Word In A Page Using Php
how to embed or open microsoft word file in a page using php script

Any Ideas How To Run Macro In Microsoft Publisher Through PHP COM ?
my macro in Publisher changes "123" into "321" (example)
but I can't be able to run it.
This is how far I get throught with PHP & Publisher:

<?
$pub = new COM('publisher.application') or die('Unable to load
Publisher');
print "Loaded Publisher, version {$word->Version}
";

$pub->Open('xxx.pub');

$pub->Documents[1]->SaveAs('xxx2.pub');

$pub = null;

?>

this works, but of course does not do anything else than open xxx.pub
and save it as xxx2.pub. I am trying to run my macro:

$pub->Documents[1]->RunMacro(replaceme);

where replaceme is my macro. I tried different variations:

$pub->Documents[1]->Run(replaceme);
$pub->Documents[1]->Application->Run(replaceme),

etc but no luck so far :(

Reading Microsoft Office Documents?
I need to be able to upload a Microsoft office document and then show the contents to the visitor, in addition i need to be able to  write documents on the fly.

Is there a way of doing this, or will i have to spend days researching and programming my own classes to handle it?

Weird ODBC Access Error With String Concatenation
trying to connect to access via ODBC. The
following query works fine if run from access:

SELECT spchacti.FNAME AS firstname, spchacti.
LNAME AS lastname, [Spchacti]![ADDR] & " " &
[Spchacti]![ADD1] AS address, "sc" AS source
FROM spchacti;

but from PHP (through PEAR DB), I get the
following error:

[nativecode=07001 [Microsoft][ODBC Microsoft
Access Driver] Too few parameters. Expected 1.]

MS says this is when you reference a non
existant column, but this isn't the problem
because even this query doesn't work:

SELECT add1 & " asasas" from spchacti Any
concatenation seems to break it, but it always
works from access. Odly, if you add Trim()
around a field, it works, so I thought I would try
Trim(Addr1) & Trim(" ,") & Trim(Add2) as
address but this breaks due to the middle one,
using Trim on a string instead of a field causes it
to break. Weird, and very VERY frusterating
because it all works peachy in access.

Linux ODBC Driver For Visual FoxPro?
Does anyone know where to find a Linux ODBC driver for Visual FoxPro databases?

PHP Will Not Read More Than 4096 From My Microsoft Sql Text Field.
I have a textarea that is saving to a mssql text (very large) field. The insert, update is working fine. However, when php reads the data using mssql_result function, I'm getting limited to 4096 characters read by php. I know that there are at least 6000 characters and I can see them using microsoft's query analyzer. This is not a magic quotes, single quote, quote, html entity or anthing like that. PHP will not read more than 4096 from my microsoft sql text field. Any ideas how I can get php to read more?

Microsoft And Zend Announce Collaboration To Enhance PHP On IIS
Microsoft's Product Unit Manager for Internet Information Services
(IIS), announced a new collaboration with Zend to improve
performance and stability of PHP on Windows.
This isn't just vaporware, either. During Andi Gutmans' keynote
(Andi is one of the creators of PHP and co-founder of Zend), Bill
announced the availability of a technical preview release of FastCGI
for IIS and demoed it for the audience as well.
FastCGI is a new component for Microsoft's Web server platform that
is available for download & evaluation today. It works IIS 6.0 in
Windows 2003 Server and IIS 5.1 in Windows XP. Even cooler, it also
works with the brand new IIS 7.0 making its debut with Windows Vista
and, later, as part of Windows Server code-named "Longhorn."
This announcement continues to solidfy IIS as the premiere Web
application server whether you are developing sites with ASP.NET or
any other server framework. Moreover, regardless of the programming
language or framework they choose, developers building sites of any
size can leverage the full capabilities of the Microsoft platform
with enterprise-class security, speed and stability.

Can I Convert MySQL Db Records Into Microsoft Word Documents?
i found the solution to export
file from mysql db into *.csv. but is there anyway to convert the
contents into *.doc and save in my webserver and providing a link for
the end users to download the word file?

FYI, the database records are obtained by end users submitting the
forms themselve and i saved it in my db...

PHP Equivalent For Server.CreateObject("Microsoft.XMLHTTP") In ASP
I'm new to PHP, so I'm trying to figure out how to do things that I used to do in ASP.

One of those things is getting data from another web page, server-side.

In ASP, I'd do this:

Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.open "GET", strURL, False
objXML.send()

I could then use regexp to pull out data from objXML.responseText.

How can I do the same thing in PHP?

PHP To MS Access Via ODBC
Newbie here and relative newbie to PHP.

Mentioned this on on a totally different forum so sorry if you get
this twice. I'm trying to use php to write to an access db and
haven't had any luck. Surfed the archives and tried the examples for
insert into via odbc from phpbuilder but it never writes the data to
the db.

The forms draw up properly and when I hit the submit button it goes to
the page that is supposed to run the code to write to a db but it
doesn't save. Created a system dsn via the examples as well. Have
Apache and php 5 installed on my machine.

Does anyone have examples of insert into from PHP to Access? I know
SQL Server is more stable but they've already been waiting forever
before I took the job and the project is already build in Access.
Plus this is for a low hit/ low volume survey type thing.

I don't get any error messages. It just doesn't store the data.

PHP & ODBC & MS Access
Can anybody link me to some good tutorials regarding using php to extract and retrive data etc from ms access please? I've followed the tutorial about retrieving data and setting up OBDC on this site and it was very helpful although i'd like to expand my knowledge.

My next task would be to learn how to add data from a web form into ms access using php. If there aren't any good tutorials perhaps someone knows a good example they could post here?

Using An Access Db From Php On Linux? Odbc?
I have my site running on a linux server, and I want to pull data from an access db on a windows server. I have ODBC set up under linux, and can connect to the mssql server that way, is there a free linux odbc driver for access?

Communicate With Access Database Using ODBC?
has anyone has any source / idea that php (under windows environment) could communicate with acess database by using ODBC?

Images In Access-DB, Display Via ODBC, SQL,
I'm trying to display an image that is stored in an MS-Access97 Database via ODBC, SQL and
PHP3 on a WinNT4.0 System (SP5). The Image (a tiff-file) is stored in the Access-DB as an OLE-Object. From an HTML-Page, I call the following php3-script. In the php3.ini-file, all "magic_quotes_" are disabled. Code:

MSSQL Access Via PDO And Windows ODBC
I'm running a "Windows Server 2003" with "MS SQL 2000" IIS and PHP5.1 as
test environment for my project. I would like to access my MSSQL-Server
via Windows ODBC and PDO. I created a System DSN an i enabled the PDO
extension in my php.ini. But the following code snippet keeps failing:

<?php
try
{
$DB = new PDO("odbc:LocalServer");
}
catch (PDOException $e)
{
echo $e->getMessage() . "<br>";
exit;
}
?>

Here is the error message:

"could not find driver"

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?

PHP ODBC Update Query To Access
For some reason I am getting a datatype mismatch on the following SQL query and I do not understand why because the field datatype is number in the access database and the update query is using a number to update to that field? PHP Code:

ODBC Query Of Access 2000 Db Using LIKE
Attempting to query MS Access database with the ODBC drivers for PHP. When
using the LIKE statement no records are returned.

Example:

$query = " Select * From Dispatch Where Customer Like '*A*' ";
$result = odbc_prepare($db,$query);
odbc_execute($result);

Does anyone out there know the syntax that I should be using for the Like
statement in the Where clause? When I do a normal query, it works
fine....Just using wildcards it does not work....

Prevent SQL Injection In ODBC And MS Access?
I'm on a GoDaddy Windows hosting using PHP and MS Access. It is well documented how to prevent SQL injection with MySQL, but how do one prevent SQL injection with ODBC and MS Access?

Any suggestions would be much appreciated. Seems like Access with PHP is fairly rare and not much information on the net is written about it.

MS Access + ODBC Links On Remote Servers
Has anyone ever figured out why an ODBC link, via PHP, will only connect properly if the DSN and .mdb files live on the same box as the web server? For some reason, the ODBC functions seem to ignore mapped network drives and even UNC path names. Anyone know of a PEAR module or third party class that will do the job?

Error In Getting Parameters From A Webpage
everytime I click the submit button, it seems that the browser cannot read or cannot get the value of $submit variable, here's my php code:

Save Error Msg With Odbc Connection To Oracle
Does anyone know how i can save an error massage i get from the odbc driver (connected to an oracle database)? I whant to use a stable php releas (not cvs).

Warning: SQL Error: [Caché ODBC][State : 08S01][Native Code 461]
I'm trying to connect PHP on Caché Database and I'm having a problem. This is the error:

Warning: SQL error: [Caché ODBC][State : 08S01][Native Code 461] [c:phpphp.exe] UNKNOWN MSG, SQL state 08S01 in SQLConnect in c:program filesapache groupapachehtdocscache_test.php on line 27

PHP knowed the ODBC Driver for InterSystem's Caché, but it stops in this problem. How can I resolve this?

Where To Get Mysql Driver
i didn't use a driver just inserted data directly throw phpmyadmin. do i need a driver? if yes from where can i get it?

Mysql Driver
I'm attempting to make what I think is a mysql driver for my site. PHP Code:

Password Access Parse Error
I must admit to knowing little (actually nothing) about .php, but this seemed to me to be the simplest way to password protect a competition page we need up and running in the next few days.

I get the following error message: Parse error: unexpected T_STRING on line 4

Can anybody explain what this means? Here are the first few lines of validate.php:

Problem With Mssql Driver
I have a strange problem while using mssql server driver:
when i update/insert in/delete a table and want to redirect after, i have
the following error message:

CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

The strange thing is that if i do a select or use mysql driver (with select,
insert, delete or update) i have no problem. Also if i update a none
existant row (ie usId = -1) there is no problem.
Here is a sample code that produce the error :

<?php
$conn = mssql_connect($server, $user, $password);
mssql_select_db($db);
$result = mssql_query("UPDATE Users SET usFirstName = 'Guillaume' WHERE usId
= 20");
mssql_close();

header("Location: $redirect");
exit();
?>

When i call this page, the database is updated and my browser goes to the
$redirect page but displays the aboved error message instead of the page.

System infos:
os : windows 2k server sp3
web: iis 5.0
php: 4.3.2
db : sql server 2000 entreprise sp2

Anyone knows the cause of this problem and/or how to resolve it ?

Looking For A FlatFile Database Driver For PHP
Introduction:
I need access to database-functionality for a project.
The problem is I cannot be sure that a database exists on all places where I
need to run the code.
I can only expect PHP to be installed on all the intranets where the
software runs.

So to mimic some databasefunctionality I first thought to use plain files to
store the data. Or maybe write away my datastructures serialized.
That is a bit cumbersome, but can be done.
Things would be nicer for if I could use real SQL.

My question:
So I wondered if there is some way for me to use real SQL-statements on a
flatfile. If that is possible I would really safe me a lot of trouble.
In that way I can use real SQL and do not expect my customers to have to
install mySQL or Postgres.

I hope I make sense. :-)


Copyright © 2005-08 www.BigResource.com, All rights reserved