Oct 26, 2002 #1 seidel Programmer Oct 23, 2002 10 MX Hello! I have a database, I need read values form this database into vbscript variables!!!! please helpme example: my database have 2 fields: ID, price how assign into variable "sum" the value from price? "sum is a varible into vbscript thanks
Hello! I have a database, I need read values form this database into vbscript variables!!!! please helpme example: my database have 2 fields: ID, price how assign into variable "sum" the value from price? "sum is a varible into vbscript thanks
Oct 28, 2002 #2 MrGreed Programmer Oct 3, 2002 284 US Using ASP: (I'm sure this can be also done with PHP) <% 'Fragmented code below. If you don't know ASP/ Learn it! dim yourValue 'Database query SQL="Select ID,Fname from SomeTable" 'create recordset set objRec=server.createobject("ADODB.recordset" 'set recordset objRec.open objConn.execute(<your SQL code>) 'set ASP variable yourValue=objRec("ID" %> <HTML> <HEAD> <Script language=vbscript> dim yourVariable 'this is how you would assign the database field 'to your vbscript variable yourVariable=<%=yourValue%> </Script> </Head> <BODY> </BODY> </HTML> "did you just say Minkey?, yes that's what I said." MrGreed Upvote 0 Downvote
Using ASP: (I'm sure this can be also done with PHP) <% 'Fragmented code below. If you don't know ASP/ Learn it! dim yourValue 'Database query SQL="Select ID,Fname from SomeTable" 'create recordset set objRec=server.createobject("ADODB.recordset" 'set recordset objRec.open objConn.execute(<your SQL code>) 'set ASP variable yourValue=objRec("ID" %> <HTML> <HEAD> <Script language=vbscript> dim yourVariable 'this is how you would assign the database field 'to your vbscript variable yourVariable=<%=yourValue%> </Script> </Head> <BODY> </BODY> </HTML> "did you just say Minkey?, yes that's what I said." MrGreed
Oct 29, 2002 Thread starter #3 seidel Programmer Oct 23, 2002 10 MX Many thanks for your advise! Upvote 0 Downvote