access upgrade to sqlserver (agent platform database conversion)

Published: 2018-05-08

Note: Please use Microsoft Access in Office for conversion. Office 2007 or later is recommended. Other third-party Office tools may not work.

1.Double-clickglobal.mdbto open theaccessdatabase-Database Tools-sqlserver

Image1.png 

 

 

2.Use an existing database-Next-dsn after the name

Image2.png


3.Selectsqlserver

Image3.png

 

4.Next-Browse,set a data source name,

such astest,Next,Finish

Image8.png

 

Next,select sqlserver authentication using the login id and password entered by the user, and fill in the database account and password

Image5.png

 

Next,check "Change the default database to",and select the corresponding database in the drop-down box

Image7.png 

Next-Finish-OK-OK

Image6.png

 

Enter the database password,OK

Image8.png 

Click the double arrow to add all tables on the left to the right,Next-Next-Next-Finish

Wait for all tables to be created in the database on the sqlserver server.

 

After the agent platform upgrades the database

Editconfig/const.asp

isdbsql=true  ' Database type

SqlUsername="xiuzhanwang"  ' Login account

SqlPassword="******"  ' Login password

SqlDatabaseName="xiuzhanwang"  ' Database name

SqlHostIP="sql.xxx.vhostgo.com"  ' Connection address

 

Then use sql manager or tools such as navicat for sqlserver to connect to the sqlserver database, and execute the following sql statements to modify some field types 


image.png

alter table countlist alter column c_memo nvarchar(MAX) 

alter table productlist alter column p_name nvarchar(MAX) 
alter table producttype alter column pt_memo nvarchar(MAX) 
alter table protofree alter column freeproid1 nvarchar(MAX) 
alter table ActionLog alter column Remark nvarchar(MAX) 
alter table ActionLog alter column Remark nvarchar(MAX) 
alter table cache_app alter column value nvarchar(MAX) 
alter table domaintrans alter column whoisbody nvarchar(MAX) 
alter table Free alter column f_content nvarchar(MAX) 
alter table HostRental alter column Memo nvarchar(MAX) 
alter table HostRental alter column weihulist nvarchar(MAX) 
alter table mailsitelist alter column m_agent nvarchar(MAX) 

alter table ShopCart alter column addtime datetime

alter table ShopCart  ADD DEFAULT getdate() for addtime

alter table UserDetail ADD DEFAULT getdate() for u_regdate

alter table UserDetail ADD DEFAULT 0 for u_resumesum

alter table UserDetail ADD DEFAULT 0 for u_usemoney

alter table UserDetail ADD DEFAULT 0 for u_Invoice

alter table UserDetail ADD DEFAULT 0 for u_remcount

alter table UserDetail ADD DEFAULT 0 for u_borrormax

alter table countlist ADD DEFAULT 0 for u_in

update UserDetail set u_resumesum=0 where u_resumesum is null
update UserDetail set u_usemoney=0 where u_usemoney is null
update UserDetail set u_Invoice=0 where u_Invoice is null

update userdetail set u_remcount=0 where u_remcount is null

update userdetail set u_borrormax=0 where u_borrormax is null

update countlist set u_in=0 where u_in is null

set identity_insert serverroomlist ON

Then remove the identity of the r_id field in the serverroomlist table

Note: If you use the database's built-in management tool, please uncheck "Prevent saving changes that require table re-creation" in the options

image.png