主题:用ADO连接带有密码的access数据库时遇到的问题
我用的是ADOTable控件,在其属性connection string中设置了连接字符串:
(数据源名称为shjuyuan,数据库名称为data,密码为11)
Provider=MSDASQL.1;Password=11;Persist Security Info=True;User ID=11;Data Source=shujuyuan;Initial Catalog=E:\data
之后,把Active属性置为true,datagrid 中就可以显示出数据。(未运行状态下)
但是,当我把 adotable1.open; 这句代码添加到按钮中,然后运行,当按下按钮时,就会有提示错误:
‘invalid variant type conversion’
或者我手工编辑连接字符串,并赋值:
adotable1.ConnectionString:= 'Provider=msdasql;DataSource=shujuyuan;Initial Catalog=E:\data;User Id=11;Password=11';
再运行后,仍然是相同的提示错误。
请教热心的朋友,
[em18]
(数据源名称为shjuyuan,数据库名称为data,密码为11)
Provider=MSDASQL.1;Password=11;Persist Security Info=True;User ID=11;Data Source=shujuyuan;Initial Catalog=E:\data
之后,把Active属性置为true,datagrid 中就可以显示出数据。(未运行状态下)
但是,当我把 adotable1.open; 这句代码添加到按钮中,然后运行,当按下按钮时,就会有提示错误:
‘invalid variant type conversion’
或者我手工编辑连接字符串,并赋值:
adotable1.ConnectionString:= 'Provider=msdasql;DataSource=shujuyuan;Initial Catalog=E:\data;User Id=11;Password=11';
再运行后,仍然是相同的提示错误。
请教热心的朋友,
[em18]