php access的问题
$conn=@newCOM("ADODB.Connection")ordie("ADO连接失败!");$connstr="DRIVER={MicrosoftAccessD...
$conn = @new COM("ADODB.Connection") or die ("ADO连接失败!");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("php.mdb");
$conn->Open($connstr);
$connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC);
$sql="insert into wb_user(name,aaa,sex) values('22','33','4')";
$result=odbc_exec($connid,$sql);
if($result) echo "添加成功";
else echo "失败";
/////
问题$connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC);//这句话和上面$conn->Open($connstr);有没有冲突?干啥用的,还有就是执行后怎么全部关闭,比如$conn->Close();//关闭以便释放内存 展开
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("php.mdb");
$conn->Open($connstr);
$connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC);
$sql="insert into wb_user(name,aaa,sex) values('22','33','4')";
$result=odbc_exec($connid,$sql);
if($result) echo "添加成功";
else echo "失败";
/////
问题$connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC);//这句话和上面$conn->Open($connstr);有没有冲突?干啥用的,还有就是执行后怎么全部关闭,比如$conn->Close();//关闭以便释放内存 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询