大概的功能就是日期提醒,把通讯录和日期提醒相结合。
提醒方面做的很差,技术有限。
皮肤用的是Skin++
第一次发,但之前修改过几次,目前版本0.7
做这个东西完全是因为我个人需要。
是一个多用户的工具。
有自动升级功能。
应用范围很窄。
下载地址:http://www.cppblog.com/Files/pencil/GoodFriendV0.7.rar
源代码下载:http://www.cppblog.com/Files/pencil/GoodFriend0.7.src.rar
......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace AddressList
{
public partial class FrmAccessUse : Form
{
public FrmAccessUse()
{
InitializeComponent();
}
#region 调用access标准方法
// using System.Data.OleDb;
// using System.Data;
// 连接字符串:String connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=product.mdb";
// 建立连接:OleDbConnection connection = new OleDbConnection(connectionString);
// 使用OleDbCommand类来执行Sql语句:
// OleDbCommand cmd = new OleDbCommand(sql, connection);
// connection.Open();
// cmd.ExecuteNonQuery();
#endregion
#region 连接字符串
//string strcon = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\程序书籍软件\c ......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace AddressList
{
public partial class FrmAccessUse : Form
{
public FrmAccessUse()
{
InitializeComponent();
}
#region 调用access标准方法
// using System.Data.OleDb;
// using System.Data;
// 连接字符串:String connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=product.mdb";
// 建立连接:OleDbConnection connection = new OleDbConnection(connectionString);
// 使用OleDbCommand类来执行Sql语句:
// OleDbCommand cmd = new OleDbCommand(sql, connection);
// connection.Open();
// cmd.ExecuteNonQuery();
#endregion
#region 连接字符串
//string strcon = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\程序书籍软件\c ......
连接ACCESS数据库的简单JSP代码:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=" + application.getRealPath("jsp.mdb"); //与JSP文件同一目录下的ACCESS数据库文件名:jsp.mdb
Connection conn = DriverManager.getConnection(url,"",""); //连接ACCESS数据库(url,"用户名","密码"),为空即没有设置数据的登录密码。
Statement stmt=conn.createStatement();
String sql="select * from login"; //构造SQL语句
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
int id=rs.getInt("id"); //得到数据库里面的字段id的值。
String username=rs.getString("username"); //得到数据库里面的字段username的值。
String password=rs.getString("password");
}
//关闭与数据库的连接
rs.close();
stmt.close();
conn. ......
连接ACCESS数据库的简单JSP代码:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=" + application.getRealPath("jsp.mdb"); //与JSP文件同一目录下的ACCESS数据库文件名:jsp.mdb
Connection conn = DriverManager.getConnection(url,"",""); //连接ACCESS数据库(url,"用户名","密码"),为空即没有设置数据的登录密码。
Statement stmt=conn.createStatement();
String sql="select * from login"; //构造SQL语句
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
int id=rs.getInt("id"); //得到数据库里面的字段id的值。
String username=rs.getString("username"); //得到数据库里面的字段username的值。
String password=rs.getString("password");
}
//关闭与数据库的连接
rs.close();
stmt.close();
conn. ......
1.连接数据库ConnDB()类
package tool;
/****************************
**
**属性文件与数据库均在tool包下面
**
*****************************/
/* 数据访问组件 */
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class ConnDB{
private static ConnDB instance=null;
String db_driver=null;
String db_url=null;
String db_user=null;
String db_psw=null;
String db_name=null;
String proPath="conn.properties";
Connection conn=null;
public ConnDB(){
InputStream in=getClass().getResourceAsStream(proPath);
Properties prop=new Properties();
try {
prop.load(in);
db_driver=prop.getProperty("db_driver",db_driver);
db_url=prop.getProperty("db_url",db_url);
db_user=prop.getProperty("db_user",db_user);
db_psw=prop.getPrope ......
1.连接数据库ConnDB()类
package tool;
/****************************
**
**属性文件与数据库均在tool包下面
**
*****************************/
/* 数据访问组件 */
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class ConnDB{
private static ConnDB instance=null;
String db_driver=null;
String db_url=null;
String db_user=null;
String db_psw=null;
String db_name=null;
String proPath="conn.properties";
Connection conn=null;
public ConnDB(){
InputStream in=getClass().getResourceAsStream(proPath);
Properties prop=new Properties();
try {
prop.load(in);
db_driver=prop.getProperty("db_driver",db_driver);
db_url=prop.getProperty("db_url",db_url);
db_user=prop.getProperty("db_user",db_user);
db_psw=prop.getPrope ......
创建基于对话框的应用程序ADO,向对话框中添加一个列表视图控件,并为其添加变量m_Grid
第一步:ADO对象的导入
在StdAfx.h头文件中:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, bu
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__D5ADC0DF_B5B2_4973_A035_4F2F1585998F__INCLUDED_)
#define AFX_STDAFX_H__D5ADC0DF_B5B2_4973_A035_4F2F1585998F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer ......
最常见的数据类型映射的列表
下表列出了在 Microsoft Access 和如何这些数据类型与相关 Microsoft.net 框架数据类型,并 OleDbType 枚举中使用最常见的数据类型。
收起该表格展开该表格
访问类型名称
数据库数据类型
OLE DB 类型
.NET 框架类型
成员名称
文本
VarWChar
DBTYPE_WSTR
System.String
OleDbType.VarWChar
备忘录
LongVarWCha r
DBTYPE_WSTR
System.String
OleDbType.LongVarWChar
数字: 字节
UnsignedTinyInt
dbtype_ui1
System.Byte
OleDbType.UnsignedTinyInt
是/否
布尔
DBTYPE_BOOL
System.Boolean
OleDbType.Boolean
日期/时间
日期时间
DBTYPE_DATE
System.DateTime
OleDbType.Date
货币
十进制
DBTYPE_NUMERIC
System.Decimal
OleDbType.Numeric
数字: 十进制
十进制
DBTYPE_NUMERIC
System.Decimal
OleDbType.Numeric
数字: 双
双
dbtype_r8
System.Double
OleDbType.Double
自动编号 (同步复制 ID)
GUID
DBTYPE_GUID
System.Guid
OleDbType.Guid
号码: (同步复制 ID)
GUID
DBTYPE_GUID
System.Guid
OleDbType.Guid
自动编号 (长整型)
整数
dbtype_i4
System.Int32
OleDbType.I ......