jannis Posted April 21, 2003 Report Share Posted April 21, 2003 taatad, kaa un vai ir iespeejams no php tikt pie access db (man aarzemes nogrieztas -> nesuutiet linkus) HELP! Link to comment Share on other sites More sharing options...
Roze Posted April 22, 2003 Report Share Posted April 22, 2003 Vienkaarshaakais (varbuut) veids ir taisiit taa sauktaas "DSN (Data Source Name) Less" konekcijas - proti pa taisno sleegties pie .mdb faila: <code><font color="#000000"> <font color="#0000CC"><?php </font><font color="#006600">if (!</font><font color="#0000CC">$conn </font><font color="#006600">= new </font><font color="#0000CC">COM</font><font color="#006600">(</font><font color="#CC0000">"ADODB.Connection"</font><font color="#006600">)) exit(</font><font color="#CC0000">"Unable to create an ADODB connection "</font><font color="#006600">); </font><font color="#0000CC">$strConn </font><font color="#006600">= </font><font color="#CC0000">"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" </font><font color="#006600">. </font><font color="#0000CC">[url=http://lv.php.net/realpath]realpath[/url]</font><font color="#006600">(</font><font color="#CC0000">"dbsearch.mdb"</font><font color="#006600">); </font><font color="#0000CC">$conn</font><font color="#006600">-></font><font color="#0000CC">open</font><font color="#006600">(</font><font color="#0000CC">$strConn</font><font color="#006600">); </font><font color="#0000CC">$strSQL </font><font color="#006600">= </font><font color="#CC0000">"SELECT * FROM tabula"</font><font color="#006600">; </font><font color="#0000CC">$rs </font><font color="#006600">= </font><font color="#0000CC">$conn</font><font color="#006600">-></font><font color="#0000CC">execute</font><font color="#006600">(</font><font color="#0000CC">$strSQL</font><font color="#006600">); </font><font color="#0000CC">$lauks1</font><font color="#006600">= </font><font color="#0000CC">$rs</font><font color="#006600">-></font><font color="#0000CC">Fields</font><font color="#006600">(</font><font color="#0000CC">0</font><font color="#006600">); </font><font color="#0000CC">$lauks2 </font><font color="#006600">= </font><font color="#0000CC">$rs</font><font color="#006600">-></font><font color="#0000CC">Fields</font><font color="#006600">(</font><font color="#0000CC">1</font><font color="#006600">); </font><font color="#0000CC">$lauks3 </font><font color="#006600">= </font><font color="#0000CC">$rs</font><font color="#006600">-></font><font color="#0000CC">Fields</font><font color="#006600">(</font><font color="#0000CC">2</font><font color="#006600">); while (!</font><font color="#0000CC">$rs</font><font color="#006600">-></font><font color="#0000CC">EOF</font><font color="#006600">) { echo </font><font color="#CC0000">"Lauks1 = $lauks1 | Lauks2 = $lauks2... <br/>"</font><font color="#006600">; </font><font color="#0000CC">$rs</font><font color="#006600">-></font><font color="#0000CC">MoveNext</font><font color="#006600">(); } </font><font color="#0000CC">$rs</font><font color="#006600">-></font><font color="#0000CC">Close</font><font color="#006600">(); </font><font color="#0000CC">$conn</font><font color="#006600">-></font><font color="#0000CC">Close</font><font color="#006600">(); </font><font color="#0000CC">?> </font> </font> </code> Link to comment Share on other sites More sharing options...
jannis Posted April 22, 2003 Author Report Share Posted April 22, 2003 bet taa izmanto adodb klasi, vai ne? phpa numuros piemineeta, tjipa dobonama laikam http://php.weblogs.com/adodb plz kaads to vareetu uz .lv servera uzlikt? Link to comment Share on other sites More sharing options...
Roze Posted April 26, 2003 Report Share Posted April 26, 2003 Nee tas bija itkaa COM piemeers (kam gan ir tikai supports uz Windows versijaam).. Bet nu vari savaakt adodb sheit http://roze.lv/php/ Link to comment Share on other sites More sharing options...
jannis Posted April 27, 2003 Author Report Share Posted April 27, 2003 vispaar ar tiem COM objektiem izskataas ka var reaalas lietas biidiit. jaaeksperimentee. Link to comment Share on other sites More sharing options...
jannis Posted May 3, 2003 Author Report Share Posted May 3, 2003 njaa izmantojot to COM, datus no db ar vaicaajumu izdabuut varu, izvadiit smuku tabulu arii, bet kaa izdabut taa lauka nosaukumu, tjipa fieldname (arii lauka tipu un citu infu)?? Link to comment Share on other sites More sharing options...
laacz Posted May 5, 2003 Report Share Posted May 5, 2003 Jannis, nav ārzemes vajadzīgas: http://lv.php.net/manual/en/ref.odbc.php Link to comment Share on other sites More sharing options...
Roze Posted May 5, 2003 Report Share Posted May 5, 2003 Ar COM gan nemaaceeshu teikt kaa dabuut db lauka tipu.. Tachu taakaa skatos ka tu shaa vai taa stradaa uz Windows platformas tad vienkaarshaka principaa buutuu to visu dariit caur ODBC http://www.php.net/manual/en/ref.odbc.php Un tad ar http://www.php.net/manual/en/function.odbc...-field-type.php Iisumaa http://www.phpbuilder.com/columns/siddarth...p3?print_mode=1 Ja tas viss tiks paarliks uz kaadas linux/unix kastes tad buus speciaali jaapiemeklee ODBC draiveri (unixodbc, odbcsock vai kaadi citi) un jaapaarkompilee php.. Link to comment Share on other sites More sharing options...
Recommended Posts