关于Access数据库路径在程序中被更改的问题
本人在做一个管理系统,在程序中有一段程序要把图片导入到窗口的Picturn Control中,代码如下
string pic_filename,pic_fullname
int fileid
blob emp_pic
if getfileopenname("open",pic_fullname,pic_filename,"jpg",&
"Jpg文件(*.jpg),*.jpg,"+ &
"Bmp文件(*.bmp),*.bmp",".\photo")<1 then return
end if
fileid=fileopen(pic_fullname,StreamMode!)
pic_path=pic_fullname
if fileid<>-1 then
fileread(fileid,emp_pic)
fileclose(fileid)
p_photo.setpicture(emp_pic)
end if
当执行过这段代码后,再点击保存按钮要将数据保存到数据库中,但却提示数据库路径错误
提示如下:
ODBC Microsoft Access驱动程序登录失败
在提示中可以看到原来数据库所在的.\database目录被改为了.\photo\database目录
因此目录出错,数据库连接失败
是不是在打开图片完了以后还要加上什么语句呢?
请教大家解决的方法,先谢过了!!!!!!