Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

VB type mismatch error in powerdesigner- probably very simple

Avatar of DirkVerdonck
DirkVerdonck asked on
Sybase DatabaseVisual Basic Classic
7 Comments1 Solution961 ViewsLast Modified:
I have a problem with some visual basic code that has to be executed on a powerdesigner model.
If I execute this it gives me a "type mismatch" error on line 9  (first SQL)

this is probably something really stupid, but I'm not a VB programmer and I don't have a lot of time for this script, so any help would be very welcome.

dim sql_text
sql_text = ""
dim counter
counter = 0
for each tbl in mdl.tables
  for each fld in tbl.columns
    if (  fld.stereotype <> "" ) then
       counter = counter + 1
       sql_text = sql_text + "insert into database.fieldNames(id,name,tablename,datatype)" 
       sql_text = sql_text + "values (" + counter + "," + fld.Name + "," + tbl.Name + "," + fld.DataType + ")" + vbCrLf
    END IF
   next
next