c# - Connection String problems with OLEDB on a Remote Server -
my goal: create program can copy sharepoint database daily sql server. should run server, , should run daily.
current status: sharepoint website linked local copy of accessdb file type accdb open oledb , program runs locally generating tables/columns/datatypes , copying data.
problem: when take solution , try deploy remote server has popup window asking user in segment of code opens accessdb. need window die. process must automatic cannot require human input run.
i have spent better part of day trying thing go away , program run without it. no luck google, stackoverflow, connectionstrings.com, or msdn , lot of other random websites.
relevant code:
public void opendatafromaccess(string connectionstring, string tablename, string connectionstring2) { string sqlquery = "select * [" + tablename +"]"; try { using (datatable dt = new datatable()) { using (oledbconnection conn = new oledbconnection(connectionstring)) using (oledbcommand cmd = new oledbcommand(sqlquery, conn)) using (oledbdataadapter adapter = new oledbdataadapter(cmd)) { cmd.commandtype = commandtype.text; cmd.connection.open(); adapter.selectcommand.commandtimeout = 240; adapter.fill(dt); adapter.dispose(); }
the default connection string:
string connectionstring = @"provider=microsoft.ace.oledb.12.0;data source=c:\migration\sharepoint access sql batch job\database2.accdb;jet oledb:database password=password";
things have tried include:
user id=userid;password=pass persist security info=false; delay validation=true integrated security=true; mode=read;
and every other setting find in connection strings no avail.
the popup has save information setting rather in program, window not save passwork when type in manually run. cannot seem accept hardcoded value??? restarting server , starting service credential manager , registry editor not help.
when try hardcode user various errors occur such as:
"the workgroup information file missing or opened exclusivly program"
the user not certified or similar message (when user should be, , have tried several users , creating new users , admins etc. being very careful type in thought correctly) have tried edit sharepoint admins in access when try edit permissions links me sharepoint.
there no jet registry had install accessdatabaseengine_x64 manually. program did not run on server before this.
i sure solution simple have tried far has not worked.
ideas???
the project canceled no solution necessary.
the database has issues authentication , method not support passing specific user seems, throw out , try using sharepoint virtual server or other method. hear newer libraries support sharepoint better.
Comments
Post a Comment