在C/S模式下,请问在客户端怎样连接服务器端的access数据库??

解决方案 »

  1.   

    只有把access放在共享目录里!为啥非要把桌面数据库搞成数据库服务器呢!
      

  2.   

    ……?
    把连接字符串的server设置为服务器IP地址就可以啊
      

  3.   

    我也没办法,拿到的要求就是要把access作为数据库服务器?
      

  4.   

    IoriYagami80(80后的八神庵) ( ) 信誉:100    Blog   加为好友  2007-04-20 13:39:50  得分: 0  
     
     
       把数据库位置写成网路路径
      
     
    可以说的详细点吗?不懂你的意思,谢谢了
      

  5.   

    共享文件/通过Web Service等方式操作数据库
      

  6.   

    请给个例子吧,没有做过access的远程连接,谢谢了
      

  7.   

    If you just want to establishes a connection between the local computer and a remote network share, simply use Process.Start to
    issue a net use command.using System.Diagnostics;
    ....
    string device = "X:"; // local device mapping
    string uncpath = @\\server\share;
    ProcessStartInfo psi = new ProcessStartInfo();
    psi.FileName = "cmd.exe";
    psi.Arguments = String.Format("/c net use {0} {1}", device, uncpath);
    psi.WindowStyle = ProcessWindowStyle.Minimized;
    Process proc = Process.Start(psi);
    proc.WaitForExit();
    if(proc.ExitCode != 0)
    ....
    .....Willy.
      

  8.   

    Here's how to achieve the same using Management namespace classes.using System;
    using System.Management;public class Wmis {
    public static void Main() {
    string sharename = "TEMP";
    UInt32 ret = Create("Test", 10, sharename, "passwordhere", @"c:\tmp");
    Console.WriteLine("Creation returned: " + ret);
    ManagementObject share = new ManagementObject("Win32_Share=" + "'" + sharename +"'");
    string s = (string)share.Properties["Description"].Value; // read property "description"
    Console.ReadLine(); // press enter to delete share
    ret = Delete(share);
    Console.WriteLine("Deletion returned: " + ret);
    }
    public static UInt32 Create(string Description, UInt32 MaximumAllowed, string Name, string Password, string Path)
    {
    ManagementBaseObject inParams = null;
    ManagementClass classObj = new System.Management.ManagementClass(null, "Win32_Share", null);
    inParams = classObj.GetMethodParameters("Create");
    inParams["Access"] = null; // default Security descriptor used
    inParams["Description"] = Description;
    inParams["MaximumAllowed"] = MaximumAllowed;
    inParams["Name"] = Name;
    inParams["Password"] = Password;
    inParams["Path"] = Path;
    inParams["Type"] = 0; // Disk drive 0, print queue 1
    ManagementBaseObject outParams = classObj.InvokeMethod("Create", inParams, null);
    return Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
    }public static UInt32 Delete(ManagementObject share)
    {
    ManagementBaseObject inParams = null;
    ManagementBaseObject outParams = share.InvokeMethod("Delete", inParams, null);
    return System.Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
    }
    }Willy.
      

  9.   

    http://www.dotnet247.com/247reference/msgs/11/56914.aspx