ADO Value ਪ੍ਰਾਪਰਟੀ
ਵਿਆਖਿਆ ਅਤੇ ਵਰਤੋਂ
Value ਪ੍ਰਾਪਰਟੀ ਨੂੰ ਸੈਟ ਜਾਂ ਵਾਪਸ ਦੇ ਸਕਦੇ ਹਨ ਜੋ Parameter, Field ਜਾਂ Property ਆਬਜੈਕਟ ਦੀ ਕੀਮਤ ਨੂੰ ਦਰਸਾਉਂਦੀ ਹੈ。
ਆਬਜੈਕਟ | Value ਪ੍ਰਾਪਰਟੀ ਦੀ ਵਰਣਨਾ |
---|---|
Parameter |
Value ਕੀਮਤ ਨੂੰ ਸੈਟ ਜਾਂ ਵਾਪਸ ਦੇ ਸਕਦੇ ਹਨ ਜੋ Parameter ਆਬਜੈਕਟ ਦੀ ਕੀਮਤ ਨੂੰ ਦਰਸਾਉਂਦੀ ਹੈ。 ਟਿੱਪ: Value ਪ੍ਰਾਪਰਟੀ ਪੜ੍ਹਨ ਤੋਂ ਪਹਿਲਾਂ, Recordset ਆਬਜੈਕਟ ਨੂੰ ਬੰਦ ਕਰਨਾ ਚਾਹੀਦਾ ਹੈ। Parameter ਆਬਜੈਕਟ ਲਈ, ADO ਸਿਰਫ ਇੱਕ ਵਾਰ Value ਪ੍ਰਾਪਰਟੀ ਪੜ੍ਹਦਾ ਹੈ。 |
ਫੀਲਡ |
Value ਪ੍ਰਾਪਰਟੀ ਨੂੰ ਸੈਟ ਜਾਂ ਵਾਪਸ ਦੇ ਸਕਦੇ ਹਨ ਜੋ ਫੀਲਡ ਆਬਜੈਕਟ ਦੀ ਮੌਜੂਦਾ ਕੀਮਤ ਨੂੰ ਦਰਸਾਉਂਦੀ ਹੈ。 ਟਿੱਪ: ਨਵਾਂ ਫੀਲਡ ਆਬਜੈਕਟ ਜੋ ਰਿਕਾਰਡ ਦੇ Fields ਕਲੈਕਸ਼ਨ ਵਿੱਚ ਜੋੜਿਆ ਗਿਆ ਹੈ, ਤੁਸੀਂ ਕਿਸੇ ਹੋਰ ਪ੍ਰਾਪਰਟੀ ਨੂੰ ਸੈਟ ਕਰਨ ਤੋਂ ਪਹਿਲਾਂ ਪਹਿਲਾਂ Value ਪ੍ਰਾਪਰਟੀ ਨੂੰ ਸੈਟ ਕਰਨਾ ਚਾਹੀਦਾ ਹੈ ਅਤੇ Fields ਕਲੈਕਸ਼ਨ ਦੇ Update ਨੂੰ ਬੁਲਾਉਣਾ ਚਾਹੀਦਾ ਹੈ。 |
ਪ੍ਰਾਪਰਟੀ |
Value ਪ੍ਰਾਪਰਟੀ ਨੂੰ ਸੈਟ ਜਾਂ ਵਾਪਸ ਦੇ ਸਕਦੇ ਹਨ ਜੋ ਪ੍ਰਾਪਰਟੀ ਆਬਜੈਕਟ ਦੀ ਮੌਜੂਦਾ ਕੀਮਤ ਨੂੰ ਦਰਸਾਉਂਦੀ ਹੈ。 ਟਿੱਪ: ਤੁਸੀਂ ਸਿਰਫ ਪੜ੍ਹਨ ਵਾਲੀ ਪ੍ਰਾਪਰਟੀ ਨੂੰ Value ਸੈਟ ਨਹੀਂ ਕਰ ਸਕਦੇ。 |
ਸਫ਼ਟਵੇਅਰ
objectname.Value
ਇੰਸਟੈਂਸ
ਫੀਲਡ ਆਬਜੈਕਟ ਲਈ:
<% 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).Value) rs.Close conn.close %>
ਪੈਰਾਮੀਟਰ ਆਬਜੈਕਟ ਲਈ:
<% 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 %>
ਪ੍ਰਾਪਰਟੀ ਆਬਜੈਕਟ ਲਈ:
<% 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") 'Display the property attributes of the Orders Table for each prop in rs.Properties response.write("Attr:" & prop.Attributes & "<br />") response.write("Name:" & prop.Name & "<br />") response.write("Value:" & prop.Value & "<br />") next rs.close conn.close set rs=nothing set conn=nothing %>