ADO Type အရေးယူရာ
အသုံးပြုနည်းဥပဒေ
Type အရေးယူရာမှာ စစ်ဆေးရန် သို့မဟုတ် လက်ခံစားနိုင်သည် DataTypeEnum အတ္ထုပါ အတ္ထုပါ သည် Parameter, Field သို့မဟုတ် Property အားအပေါ် ကြောင်း ပြောဆိုနိုင်သည်
အရာ | Type အားရတနာများကို |
---|---|
Parameter | သတိပုံနှိပ်စက်ရာတွင် Parameter အား Type အရေးယူရာမှာ လက်ခံစားနိုင်သည် |
Field | သတိပုံနှိပ်စက်ရာတွင် Record အား Fields အဖွဲ့တွင် ပြင်ဆင်ထားသော အခြား Field အား သာသာကြည်းမဲ့ ကြောင်း သို့မဟုတ် အသုံးပြုသူမှာ Fields အဖွဲ့၏ Update စနစ်ကို အောင်မြင်စွာ ကြားသတ်ခဲ့သော်လည်း Type သည် သာသာကြည်းမဲ့/လက်ခံစားနိုင်သည် |
Property | သတိပုံနှိပ်စက်ရာတွင် Property အား Type အရေးယူရာမှာ သာသာကြည်းမဲ့ကြောင်း |
ပြောဉ်
objectname.Type
အကြိမ်
သတိပုံနှိပ်စက်ရာတွင် Field အား
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "c:/webdata/northwind.mdb" set rs = Server.CreateObject("ADODB.Recordset") rs.open "Select * from orders", conn response.write(rs.Fields(0).Type) rs.Close conn.close %>
သတိပုံနှိပ်စက်ရာတွင် Parameter အား
<% set comm=Server.CreateObject("ADODB.Command") set para=Server.CreateObject("ADODB.Parameter") para.Type=adVarChar para.Size=25 para.Direction=adParamInput para.Value=varfname comm.Parameters.Append para %>
သတိပုံနှိပ်စက်ရာတွင် Property အား
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "c:/webdata/northwind.mdb" set rs = Server.CreateObject("ADODB.Recordset") rs.open "Select * from orders", conn set prop=Server.CreateObject("ADODB.Property") Orders အချက်အလက် အပိုင် အချက်အလက် ပြပြော for each prop in rs.Properties response.write("Attr:" & prop.Attributes & "<br />") response.write("Name:" & prop.Name & "<br />") response.write("Value:" & prop.Value & "<br />") response.write("Type:" & prop.Type & "<br />") next rs.close conn.close set rs=nothing set conn=nothing %>