loving_php2008 Posted October 30, 2008 Share Posted October 30, 2008 i have problem while i send data to access... i hope i get the answers..thanks for alll Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/ Share on other sites More sharing options...
predator12341 Posted October 30, 2008 Share Posted October 30, 2008 How can we help you if you have: 1: not provided any code 2: described what the porblem is in more detail then "it does not send data" Regards Mark Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678492 Share on other sites More sharing options...
Prismatic Posted October 30, 2008 Share Posted October 30, 2008 Do you mean Microsoft Access? Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678495 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 thanks dear...i will send it. Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678498 Share on other sites More sharing options...
predator12341 Posted October 30, 2008 Share Posted October 30, 2008 i think he means MS Access. but then again he dont exactly explain himself well Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678519 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 i want to insert data from php to microsoft access ,but i got warning.. its the error that i got PHP Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in C:\Inetpub\wwwroot\php\test.php on line 8 . and its the code: <?php $conn=odbc_connect('test','root',''); if($conn) { echo "connect"; } $sql="insert into t1 values(1,'emmy')"; odbc_exec($conn,$sql); ?> Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678523 Share on other sites More sharing options...
predator12341 Posted October 30, 2008 Share Posted October 30, 2008 have you enable the odbc lib file in the php.ini? Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678530 Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 The string 'test' is not a dsn. Been a long while since Ive programmed in asp but from memory it would look something like... DRIVER={Microsoft Access Driver (*.mdb)}; You'll need to research what a dsn (the expected firest perameter) is. Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678533 Share on other sites More sharing options...
Mchl Posted October 30, 2008 Share Posted October 30, 2008 Since he got the error on odbc_exec and not on odbc_connect, he has the extension enabled. @loving_php2008: can you execute a SELECT query for example? Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678538 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 i didnt enabled that in php.ini...... what i enable in php.ini... can you tell me please..? but with select its ok.. i get the data without any problems Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678544 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 its about odbc in (php.ini) file: [ODBC] ;odbc.default_db = Not yet implemented ;odbc.default_user = Not yet implemented ;odbc.default_pw = Not yet implemented ; Allow or prevent persistent links. odbc.allow_persistent = On ; Check that a connection is still valid before reuse. odbc.check_persistent = On ; Maximum number of persistent links. -1 means no limit. odbc.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. odbc.max_links = -1 ; Handling of LONG fields. Returns number of bytes to variables. 0 means ; passthru. odbc.defaultlrl = 4096 ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation ; of uodbc.defaultlrl and uodbc.defaultbinmode odbc.defaultbinmode = 1 Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678547 Share on other sites More sharing options...
Mchl Posted October 30, 2008 Share Posted October 30, 2008 Since you can perform SELECT query, it means your odbc connection works. No need to change anything in php.ini See this article for some ideas about the error you're getting. Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678552 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 thanks mchl but i didnt get any help with that... Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678570 Share on other sites More sharing options...
Mchl Posted October 30, 2008 Share Posted October 30, 2008 I don't work with Access so I will not be able to give you any more advice unfortunately. Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678577 Share on other sites More sharing options...
predator12341 Posted October 30, 2008 Share Posted October 30, 2008 whay do you want to use access anyway got for MySQL i would rate it alot better than access and it will be easier for you to work with in php Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678598 Share on other sites More sharing options...
DeanWhitehouse Posted October 30, 2008 Share Posted October 30, 2008 I think ASP is better designed for access. Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678604 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 but i want to remember one thing also iam using IIS Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678607 Share on other sites More sharing options...
Mchl Posted October 30, 2008 Share Posted October 30, 2008 Whenever I see someone using Access I just assume he/she doesn't have a choice in the matter. Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678610 Share on other sites More sharing options...
predator12341 Posted October 30, 2008 Share Posted October 30, 2008 <?php $conn=odbc_connect('test','root',''); if($conn) { echo "connect"; } $sql="insert into t1 values(1,'emmy')"; odbc_exec($conn,$sql); ?> he is using php is he not? Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678617 Share on other sites More sharing options...
DeanWhitehouse Posted October 30, 2008 Share Posted October 30, 2008 No one said he wasn't Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678622 Share on other sites More sharing options...
predator12341 Posted October 30, 2008 Share Posted October 30, 2008 how did ASP come into the picture. im lost lol Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678647 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 i really need help with that... Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678660 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 any one find solution for that... Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678817 Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 Does the query work when executed within access itself? The best I could suggest is to clean up your syntax a little. $sql="INSERT INTO t1 VALUES (1,'emmy')"; Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678820 Share on other sites More sharing options...
loving_php2008 Posted October 30, 2008 Author Share Posted October 30, 2008 hi dear.. in access it work well.. Quote Link to comment https://forums.phpfreaks.com/topic/130742-solved-php-with-access/#findComment-678827 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.