ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¨Ï¥Îexcel vba°õ¦æsql»yªk¬d¸ßmysql¥X²{°ÝÃD

[µo°Ý] ¨Ï¥Îexcel vba°õ¦æsql»yªk¬d¸ßmysql¥X²{°ÝÃD

¦U¦ì¤j¤j¦n¡G

  ¤p§Ìªñ¤é¤w±N¤½¥q¸ê®Æ®wÂà´«¦¨MYSQL¸ê®Æ®w¡A¤]¶}©l¨Ï¥Î
EXCEL ¨Ó³s±µMYSQL¸ê®Æ®w¡C

¸ê®Æ®w¦w¸Ë¡GAPPSERV-WIN32-5.9
ODBC ³]©wCHARACTER SET¡GBIG5

¦b¤½¥qEXCEL VBA SQL»yªk¦p¤U¥i逹¦¨¡G
  mSqlCls = "SELECT SERSNO,BYPARTNO,¶µ¦¸¸¹½X FROM INVITEM WHERE SERSNO='AT  03012345678' AND MSGCODE='5105S'"   

  ¦ý¤p§Ì¦b®a°õ¦æ¤W­z»yªk·|¥X²{¤U¦C°ÝÃD
ERR NUMBER¡G-2147217900
ERR DESCRIPTION¡G
[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '¶µ¦¸¸¹½X FROM INVITEM WHERE SERSNO='AT  0312345678' AND MSGCODE='5105S'' at line 1

¦ý¦pªG±NÄæ¦ì"¶µ¦¸¸¹½X"²¾°£¨Ã°õ¦æ«o¥i¦¨¥\
mSqlCls = "SELECT SERSNO,BYPARTNO FROM INVITEM WHERE SERSNO='AA  0312345678' AND MSGCODE='5105S'"   

¦]¦¹¡A¤p§Ì´ú¸Õ¦bSQL»yªk¤¤¡A¥u­nÄæ¦ì«ü©wªº¬O­^¤åªºÄæ¦ì¦WºÙ³£¥i逹¦¨¡A¦ý¥u­n¦³¤¤¤åÄæ¦ì¦WºÙ®É³£·|¥¢±Ñ©O¡H
½Ð¦U¦ì¤j¤j¯à¥X¤â¨ó§U¤p§Ì¬ð¯}¦¹§x¹Ò¡C

·P®¦¦U¦ì¤j¤j¡I

¦U¦ì¤j¤j¦n¡G

  ¤p§Ì¦b¦¹¶é¦aªºMYSQL°Q½×°Ï¤º
§ä¨ìMINª©¥D¤j¤jªº¤@½s¤¶²ÐMYSQL
¸Ñ¨M¤¤¤å¶Ã½X°ÝÃD¡A¨Ã­É¥Ñª©¥D¤j¤j
ªº³s±µ¦r¦ê¤w¥i¸Ñ¨M¦¹°ÝÃD¤F¡C

­º¥ý·PÁÂMINª©¥D¤j¤j
¦P®É¤]·PÁ¦U¦ì¤j¤j¡C

Cnnl.Open "Driver={MySQL ODBC 3.51 Driver};Server=SERVER_NAMEort=3306;Database=test;CharSet=big5;Uid=rootwd=;Option=16387"

·P®¦¦U¦ì¤j¤j¡I

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD