vb中如何建立一个dbf表文件,并同时建立几个中文字段,最好给个小例子

解决方案 »

  1.   

    Private Sub CreateDbf()   'mpath为dbf文件路径,UDbfName表名,str1字段字符串
        Dim DbfCn as new ADODB.Connection
        Dim strCnn as String
        strCnn = "Provider=VFPOLEDB.1;Data Source=" & mpath & ";Collating Sequence=MACHINE ;Mode=Share Deny Write"    
        DbfCn .Execute "create table " & UDbfName & ".dbf (" & str1 & ")"
    End Sub
      

  2.   

    漏了一句
    Private Sub CreateDbf()   'mpath为dbf文件路径,UDbfName表名,str1字段字符串
        Dim DbfCn as new ADODB.Connection
        Dim strCnn as String
        strCnn = "Provider=VFPOLEDB.1;Data Source=" & mpath & ";Collating Sequence=MACHINE ;Mode=Share Deny Write"  
        DbfCn .Open strCnn  
        DbfCn .Execute "create table " & UDbfName & ".dbf (" & str1 & ")"
    End Sub
      

  3.   

    在 Access 数据库上建立一个连接对象 cncn.Execute "SELECT '' AS 字符字段1, 0 AS 数字字段2, ... INTO 表名 IN ""C:\DBASE\DATA\SALES"" ""dBASE IV;"" FROM [任意一个Access表名]"
      

  4.   

    Private Sub CreateDbf()   'mpath为dbf文件路径,UDbfName表名,str1字段字符串
        Dim DbfCn as new ADODB.Connection
        Dim strCnn as String
        strCnn = "Provider=VFPOLEDB.1;Data Source=" & mpath & ";Collating Sequence=MACHINE ;Mode=Share Deny Write"  
        DbfCn .Open strCnn  
        DbfCn .Execute "create table " & UDbfName & ".dbf (" & str1 & ")"
    End Sub
      

  5.   

    没有dbf文件,联接可以吗?