Store an Image(OLE Object) into Access Data Base
Store an Image(OLE Object) into Access Data Base
C# Winform application Store an Image into Access Data Base
用以下方法
/// 2010-02-26 Forever
private void SaveImageInDataBase()
{
OleDbConnection conn = null;
try
{
string strDBFile = Environment.CurrentDirectory + @"\Test.mdb";
string connstr = "Jet OLEDB:Database Password=;Data Source='" + strDBFile + "';Password=;Provider='Microsoft.Jet.OLEDB.4.0'";
conn = new OleDbConnection(connstr);
OleDbCommand cmd;
String strimg = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\test2.bmp";
//Read Image Bytes into a byte array
//Initialize byte array with a null value initially.
byte[] imageData = null;
//Use FileInfo object to get file size.
FileInfo fInfo = new FileInfo(strimg);
&nb
相关文档:
uses
ADODB;
procedure TForm1.SetupTable(sender:tobject);
Var
adocon1:TADOConnection;
strSQL:string;
Const
SConnectionString= 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;'
+'Jet OLEDB:Database Password=%s;';
begin
adocon1:=TADOConnection.creat(self);
adocon1.ConnectionString:=format(S ......
import java.sql.*;
public class ConnectAccess {
/**
* 初学者请注意:
* 1:先建立一个access文件a1.mdb,并放在D:\下;
* 2:在数据库文件a1.mdb中建立一个表Table1;
* 3:为Table1添加一列,并插入至少一条记录;
* 4:本文是一个完整的类,直接拿去运行就可以。
*/
public static void main(Stri ......
access日期和时间函数
access日期和时间函数
------------------------------------------------
设置当前日期或时间。 Date ,Now, Time
计算日期: DateAdd, DateDiff, DatePart
返回日期: DateSerial, DateValue
返回时间: TimeSerial, TimeValue
设置日期或时间: Date, Time
计时: Timer
在帮助 ......