asp access 中文问题

asp获取access表字段名称

  DBname="JXC.mdb"
  connstr="DBQ="+server.mappath(dbName)+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};uid=admin;pwd=rsa1314"
  set conn=server.createobject("ADODB.CONNECTION")
  conn.open connstr
 
  '获取字段中文名称
  set field_rs=Server.CreateObject("ADODB.recordset")
  field_sql="select * from KC"
  field_rs.Open field_sql, conn  
  fieldname1 = field_rs(1).name
  field_rs.close 

  sql="select * from KC where " & fieldname1 & "=1"
  Response.write(sql)
  set field_rs=Server.CreateObject("ADODB.recordset")
 
  field_rs.Open field_sql, conn  
  fieldname1 = field_rs(1).name
  Response.write(field_rs(1))
  field_rs.close 


asp在查询access表字段名称为中文出错时

检查asp文件的格式是否为ansi

你可能感兴趣的:(asp access 中文问题)