2017年1月27日 星期五

2016年12月27日 星期二

[MySQL]change root password


>sudo /etc/init.d/mysql stop
>sudo mysqld_safe --skip-grant-tables &


Starting mysqld daemon with databases from /var/lib/mysql
(continue typing)
mysql -u root

>use mysql;
>update user set authentication_string = password('root') where user = 'root' ;
>FLUSH PRIVILEGES;

2016年12月15日 星期四

[ASP]UTF8中文亂碼

更新舊code遇到問題...

程式開頭加上
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.CharSet = "UTF-8"%>
<%Response.CodePage = 65001%>

2016年8月5日 星期五

[MSSQL]複寫失敗SQL Server 2005不支援的類型

啟動複寫監視器 檢視詳細錯誤

螢幕截取_2016.08.04_17h58m20s_065_螢幕截取_2016.08.04_18h00m06s_066_

這裡提示某Table用了05不支援的類型Time 但Server已是08以上版本

檢查相容性層級的設定 確認不會造成其他問題才調整

螢幕截取_2016.08.04_18h05m10s_068_

在不更動相容性層級的前提下

如果欄位非必要 我作法是取消該欄的複寫或改支援的類型

2014年12月11日 星期四

[VB6]read utf-8 txt file

txt檔案內容
1,安,安安,45483
2,安,安安,45483
3,安,安安,45483

prj1


Dim objStream As New ADODB.Stream
Dim txtFile() As String
Dim txtLine() As String
Dim dir As String: dir = "C:\"
Dim fName As String: fName = "test.txt"
Set objStream = CreateObject("ADODB.Stream")
objStream.Charset = "utf-8"
objStream.Open
objStream.LoadFromFile (dir & fName)
Dim strData As String: strData = objStream.ReadText()
Dim count As Integer: count = 0
txtFile = Split(strData, Chr(13) & Chr(10))
For count = 0 To UBound(txtFile) - 1
txtLine = Split(txtFile(count), ",")
Next