thaicosmic.com

หนัง

วันเสาร์ที่ 19 ตุลาคม พ.ศ. 2556

อ้างอิงฟังชั่นในไฟล์ mdb อื่นใน directory เดียวกัน

Function FixUpRefs()
Dim loRef As Access.Reference
Dim intCount As Integer
Dim intX As Integer
Dim blnBroke As Boolean
Dim strPath As String
Dim FoundSpacialRef As Boolean
On Error Resume Next

'Count the number of references in the database
intCount = Access.References.Count

'Loop through each reference in the database
'and determine if the reference is broken.
'If it is broken, remove the Reference and add it back.
FoundSpacialRef = False
For intX = intCount To 1 Step -1
            Set loRef = Access.References(intX)
            With loRef
                        blnBroke = .IsBroken
                        strPath = .FullPath
                        If blnBroke = True Or Err <> 0 Then
                     
                                strPath = .FullPath
                                With Access.References
                                                .Remove loRef
                                                .AddFromFile strPath
                                End With

                        End If
                '===
                        If .Name = "PolngpoleVba" Then
                                    FoundSpacialRef = True
                         End If
                    '===
            End With
Next

If FoundSpacialRef Then
    Access.References.Remove Access.References("PolngpoleVba")
End If
    Access.References.AddFromFile CurrentProject.Path & "\" & "PolngpoleVba.mdb"
 
Set loRef = Nothing

' Call a hidden SysCmd to automatically compile/save all modules.
Call SysCmd(504, 16483)
End Function

วันศุกร์ที่ 18 ตุลาคม พ.ศ. 2556

เพิ่มสถานบริการใน jhcis

VBA เพิ่มสถานบริการใน jhcis โดย ms-access 2003 ให้เปลี่ยนชื่อไฟล์สถานพยาบาลเป็น hospitals.txt แล้วใส่ใน โฟล์เดอร์เดียวกันกับไฟล์ access นี้

ในโมดูลใส่
Public Function GetDBPath() As String
    Dim strFullPath As String
    Dim i As Integer

    strFullPath = CurrentDb().Name

    For i = Len(strFullPath) To 1 Step -1
        If Mid(strFullPath, i, 1) = "\" Then
            GetDBPath = Left(strFullPath, i)
            Exit For
        End If
    Next
End Function

และในฟอร์มใส่
Private Sub Form_Load()
    CodeDb.Execute "INSERT INTO chospital ( hoscode, hosname, provcode, distcode, subdistcode, mu ) SELECT hospitals.F1, hospitals.F2, hospitals.F4," & _
    "hospitals.F5, hospitals.F6, hospitals.F7 FROM [Text;HDR=NO;FMT=Delimited(,);CharacterSet=874;Database=" & _
    GetDBPath & " ;].hospitals.TXT AS hospitals LEFT JOIN chospital ON hospitals.F1=chospital.hoscode WHERE (((chospital.hoscode) Is Null));"
End Sub

วันเสาร์ที่ 12 ตุลาคม พ.ศ. 2556

update java

su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer
exit

วันเสาร์ที่ 28 กันยายน พ.ศ. 2556

ติดตั้ง xampp 1.6.8a บน ubuntu

sudo su
wget http://www.apachefriends.org/download.php?xampp-linux-1.6.8a.tar.gz
tar xvfz xampp-linux-1.6.8a.tar.gz -C /opt
/opt/lampp/lampp start

AddDefaultCharset UTF-8
/opt/lampp/etc/extra/httpd-xampp.conf

sudo su
wget https://jaist.dl.sourceforge.net/project/xampp/XAMPP Linux/1.6.7/xampp-linux-1.6.7.tar.gz
tar xvfz xampp-linux-1.6.7.tar.gz -C /opt
/opt/lampp/lampp start

วันพุธที่ 11 กันยายน พ.ศ. 2556

Pangram ภาษาไทย

Pangram ภาษาไทย

เป็นมนุษย์สุดประเสริฐเลิศคุณค่า
กว่าบรรดาฝูงสัตว์เดรัจฉาน
จงฝ่าฟันพัฒนาวิชาการ
อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร
ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า
หัดอภัยเหมือนกีฬาอัชฌาสัย
ปฏิบัติประพฤติกฎกำหนดใจ
พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอยฯ

ขาดตัว "ฦ" แต่พบว่าจริงๆ แล้วขาดตัว ฃ
ฅ ณ ส่วน "ฦ" "ฤ" เป็นสระไม่ใช่พยัชนะ


นายสังฆภัณฑ์ เฮงพิทักษ์ฝั่ง ผู้เฒ่าซึ่งมีอาชีพเป็นฅนขายฃวด
ถูกตำรวจปฏิบัติการจับฟ้องศาล ฐานลักนาฬิกาคุณหญิงฉัตรชฎา ฌานสมาธิ