English
Forum

SQL Tabellenfelder inquire Access

 

Christof
Neuß
Hi,

time again a Question SQL with of/ one Access-data base in the background.
i want simply The boxes UND DEREN ART of/ one designed scheduler inquire.

In VBA does it well so:

How can I the because translate? or knows someone another Possibility?
 
Win10 16 GB RAM
11/13/11  
 



I at least have of Access-Databases and VBA no idea. ^^
 
11/13/11  
 




Uwe
''Pascal''
Niemeier
I bin's time again
window 600,600
def %SQL_HANDLE_STMT 3
def %SQL_NTS        -3
var File$="D:\Archive\Settings\Alcatel 701\Message.mdb"
var name$="Inbox"
var Init$="Driver={Microsoft Access coachman (*.mdb)};Dbq="+File$
var Command$="SELECT TOP 1 * FROM "+name$
db("SQLInit",Init$)
declare Handle&
external("odbc32.dll","SQLAllocHandle",%SQL_HANDLE_STMT,&SQLDBC,addr(Handle&))
external("odbc32.dll","SQLExecDirect",Handle&,Command$,%SQL_NTS)
declare Count&
external("odbc32.dll","SQLNumResultCols",Handle&,addr(Count&))'--amount boxes
declare Text#:dim Text#,255
declare a&,b&,c&,d&,e&

whileloop 1,Count&

    cls
    external("odbc32.dll","SQLDescribeCol",Handle&,&loop,Text#,255,addr(a&),addr(b&),addr(c&),addr(d&),addr(e&))
    external("oleaut32.dll","VarI4FromI2",b&,addr(b&))'--Conversion of SHORT to LONG
    print "Index         ",&loop
    print "Name          ",string $(Text#,0)
    print "NameLength    ",a&
    print "DataType      ",b&
    print "ColumnSize    ",c&
    print "DecimalDigits ",d&
    print "Nullable      ",e&
    print
    print "<ENTER>"
    waitkey

endwhile

print "Fertig"
external("odbc32.dll","SQLFreeHandle",%SQL_HANDLE_STMT,Handle&)
db("SQLDone")
dispose Text#
waitkey
end
'
'Info:
'DataType is of type SQLSMALLINT
'with negativen Values becomes therefore at Reading the omen-bit not correctly umgesetzt!
'Conversion of SHORT to LONG is necessary!
SQL_UNKNOWN_TYPE	  =0;
SQL_CHAR            =1;
SQL_NUMERIC         =2;
SQL_DECIMAL         =3;
SQL_INTEGER         =4;
SQL_SMALLINT        =5;
SQL_FLOAT           =6;
SQL_REAL            =7;
SQL_DOUBLE          =8;
SQL_DATETIME        =9;
SQL_TIME            =10;
SQL_TIMESTAMP       =11;
SQL_VARCHAR         =12;
SQL_LONGVARCHAR    =(-1);
SQL_BINARY         =(-2);
SQL_VARBINARY      =(-3);
SQL_LONGVARBINARY  =(-4);
SQL_BIGINT         =(-5);
SQL_TINYINT        =(-6);
SQL_BIT            =(-7);

window 600,600
 $H windows.ph
 $H ocx3a.ph
 $I ocx3a.inc
ocxInit()
var File$="D:\Archive\Settings\Alcatel 701\Message.mdb"
var name$="Inbox"
var Connect$="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+File$
var Command$="Select TOP 1 * from "+name$
var Rec&=ocxCreate("ADODB.Recordset")
ocxMethod(Rec&,"Open",Command$,Connect$)
var Fields&=ocxget(Rec&,"Fields")'---"Fields" without Parameter: Fields-Collection
var Count%=ocxGet(Fields&,"Count")'--amount boxes in Collection
ocxRelease(Fields&)
declare Feld&

whileloop 0,Count%-1

    cls
    Feld&=ocxGet(Rec&,"Fields",&loop)'--"Fields" with Parameter: single boxes to 0-index
    print "Index      : ",&loop
    print "Name       : ",ocxGet(Feld&,"Name")
    print "Type       : ",ocxGet(Feld&,"Type")
    print "Value      : ",left$(ocxGet(Feld&,"Value"),40)'--Content on 40 characters gekürzt
    print "DefinedSize: ",ocxGet(Feld&,"DefinedSize")'------declared Size
    print "ActualSize : ",ocxGet(Feld&,"ActualSize")'-------used Size
    print
    print "<ENTER>"
    ocxRelease(Feld&)
    waitkey

endwhile

ocxMethod(Rec&,"Close")
ocxRelease(Rec&)
ocxDeInit()
print "Fertig"
waitkey
end
'values for DataTypen with MSDN under
'https://msdn.microsoft.com/en-us/library/windows/desktop/ms675318(v=VS.85).aspx

Offtopic @ iF: Leerzeilen in the View source wären helpful

HTH
Pascal
 
11/13/11  
 




Christof
Neuß
and again be I through you a step moreover.

THANK YOU!!!!
 
Win10 16 GB RAM
11/13/11  
 



[OFFTOPIC]
Uwe ''Pascal'' Niemeier (13.11.11)
Offtopic @ iF: Leerzeilen in the View source wären helpful


functions still?!
[/OFFTOPIC]
 
11/13/11  
 




Nico
Madysa
[OFFTOPIC]
Lines, not characters, iF.
declare zwischendiesenzeilen%
print "gibt it none stood off!"

[/OFFTOPIC]
 
11/13/11  
 



Oh! Yes, naturally -

Source go Yes gezeilt ^^ -

building I again Flag for a.

there's (but) too whom Quelltextmerker if one 1:1-Source need:  [...] 
 
11/13/11  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.477 Views

Untitledvor 0 min.
H.Brill05/22/24
Stephan Lührsen08/03/21
Claus Müller11/26/17
ByteAttack01/05/16
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie