473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem with recordset.fields(i).Type, it doesn't give the type name?

I need to create a temporary table in VBA Code but recordset.fields(i).Type gives me an integer value instead of the required field's Type. For an example Field_Name= "CriteriaName" and it's Field_Type=Text.

Following Code doesn't give me the type of the field name, it just give me the integer value. Problem with recordset.fields(i).Type.

Could anyone please help me out with this? im really stuck at the momemnt?


sString = "CREATE TABLE COMPONENT("

For i = 0 To rsCreateTable.Fields.Count - 1

If i = rsCreateTable.Fields.Count - 1 Then

sString = sString + rsCreateTable.Fields(i).Name + " " + rsCreateTable.Fields(i).Type

Else

sString = sString + rsCreateTable.Fields(i).Name + " " + rsCreateTable.Fields(i).Type + ", "

END IF

Next i

sString = sString + ") "
Debug.Print sString
DoCmd.RunSQL sString
Oct 9 '07 #1
1 7356
nico5038
3,080 Expert 2GB
I guess the values you get are described here:

TypeValue TypeConstant TypeDescription
1 dbBoolean Boolean
2 dbByte Byte
3 dbInteger Integer
4 dbLong Long
5 dbCurrency Currency
6 dbSingle Single
7 dbDouble Double
8 dbDate Date/Time
9 dbBinary Binary
10 dbText Text
11 dbLongBinary Long Binary (OLE Object)
12 dbMemo Memo
15 dbGUID GUID
16 dbBigInt Big Integer
17 dbVarBinary VarBinary
18 dbChar Char
19 dbNumeric Numeric
20 dbDecimal Decimal
21 dbFloat Float
22 dbTime Time
23 dbTimeStamp Time Stamp

Just use the TypeConstant when you want to determine the type without referring to the number.

Nic;o)
Oct 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Kathryn | last post by:
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve is this - - Page loads up and some server side...
2
by: Kingdom | last post by:
I have a SelectBoxes.asp page that is working with multiple selection dropdown boxes to extract data and total the selection prices. Tom & Bob were kind enough to give me a big help getting this...
6
by: PT | last post by:
I got a form with many text boxes, checkboxes and 3 drop downs. From that 3, 2 are dependant. I can choose one drop down, and the next drop down should display the dependant values of the first...
27
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is...
0
by: ImraneA | last post by:
Hi there Have a database, where front-end interface allows user to select a ms access database. From there, standard tables are linked. Routine, that creates a spreadsheet, for each table a...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
0
by: Vash10 | last post by:
I have two asp files. Login.asp and changePass.asp. what i want to do is to make the user change his password after his first login. so what happens is login.asp is the first to be used then it is...
18
omerbutt
by: omerbutt | last post by:
AJAX PROB WITH MULTIPLE RECORDS helo iam having problem in ma code will any body look out an help, i am trying t add sale record in the database and the checkthe quantity of the part slod and...
1
by: nth | last post by:
I wan to filter the database show out information by using the user login name. Means that when that user login by entering their names n password, if correct then it will go to the other page by...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.